Logo

statsmodels.tsa.tsatools.add_trend

statsmodels.tsa.tsatools.add_trend(X, trend='c', prepend=False)[source]

Adds a trend and/or constant to an array.

Parameters:

X : array-like

Original array of data.

trend : str {“c”,”t”,”ct”,”ctt”}

“c” add constant only “t” add trend only “ct” add constant and linear trend “ctt” add constant and linear and quadratic trend.

prepend : bool

If True, prepends the new data to the columns of X.

See also

statsmodels.add_constant

Notes

Returns columns as [“ctt”,”ct”,”c”] whenever applicable. There is currently no checking for an existing constant or trend.

Previous topic

statsmodels.tsa.tsatools.add_constant

Next topic

statsmodels.tsa.tsatools.detrend

This Page