statsmodels.tsa.deterministic.Fourier¶
- class statsmodels.tsa.deterministic.Fourier(period, order)[source]¶
Fourier series deterministic terms
Notes
Both a sine and a cosine term are included for each i=1, …, order
\[\begin{split}f_{i,s,t} & = \sin\left(2 \pi i \times \frac{t}{m} \right) \\ f_{i,c,t} & = \cos\left(2 \pi i \times \frac{t}{m} \right)\end{split}\]where m is the length of the period.
Examples
Solar data has an 11-year cycle
>>> from statsmodels.datasets import sunspots >>> from statsmodels.tsa.deterministic import Fourier >>> data = sunspots.load_pandas().data >>> fourier_gen = Fourier(11, order=2) >>> fourier_gen.in_sample(data.index)
Methods
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
Flag indicating whether the values produced are dummy variables
The order of the Fourier terms included
The period of the Fourier terms
Last update:
Dec 23, 2024