def constant(ts, offset=1.5):
    """
    Generate constant errors.

    Constant errors are generated by multiplying with either constant positive
    offset or constant negative offset.

    Parameters
    ----------
    ts : (N,)array_like
        Observed time series

    offset : float, optional
        Offset multiplied to time series. If greater than 1 positive constant
        offset and if less than 1 negative constant offset. The default is 1.5.

    Returns
    ----------
    ts_const : array_like
        Time series with constant error
    """
    ts_const = ts * offset
    return ts_const
