statsmodels.tsa.deterministic.TimeTrend

class statsmodels.tsa.deterministic.TimeTrend(constant=True, order=0)[source]

Constant and time trend determinstic terms

Parameters:
constantbool

Flag indicating whether a constant should be included.

orderint

A non-negative int containing the powers to include (1, 2, …, order).

Examples

>>> from statsmodels.datasets import sunspots
>>> from statsmodels.tsa.deterministic import TimeTrend
>>> data = sunspots.load_pandas().data
>>> trend_gen = TimeTrend(True, 3)
>>> trend_gen.in_sample(data.index)
Attributes:
constant

Flag indicating that a constant is included

is_dummy

Flag indicating whether the values produced are dummy variables

order

Order of the time trend

Methods

from_string(trend)

Create a TimeTrend from a string description.

in_sample(index)

Produce deterministic trends for in-sample fitting.

out_of_sample(steps, index[, forecast_index])

Produce deterministic trends for out-of-sample forecasts

Properties

constant

Flag indicating that a constant is included

is_dummy

Flag indicating whether the values produced are dummy variables

order

Order of the time trend


Last update: Apr 18, 2024