statsmodels.tsa.deterministic.Seasonality¶
-
class statsmodels.tsa.deterministic.Seasonality(period, initial_period=
1
)[source]¶ Seasonal dummy deterministic terms
- Parameters:¶
- Attributes:¶
initial_period
The seasonal index of the first observation
is_dummy
Flag indicating whether the values produced are dummy variables
period
The period of the seasonality
Examples
Solar data has an 11-year cycle
>>> from statsmodels.datasets import sunspots >>> from statsmodels.tsa.deterministic import Seasonality >>> data = sunspots.load_pandas().data >>> seas_gen = Seasonality(11) >>> seas_gen.in_sample(data.index)
To start at a season other than 1
>>> seas_gen = Seasonality(11, initial_period=4) >>> seas_gen.in_sample(data.index)
Methods
from_index
(index)Construct a seasonality directly from an index using its frequency.
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
The seasonal index of the first observation
Flag indicating whether the values produced are dummy variables
The period of the seasonality
Last update:
Dec 16, 2024