UnobservedComponentsResult.seasonal#

property UnobservedComponentsResult.seasonal: NDArray[float64][source]#

The smoothed seasonal \(E[\gamma_t \mid y]\), shape (n,).

The sum of the harmonics, so it is the seasonal effect on the observation and not the raw state block.

Raises:

SpecificationError – If no seasonal was specified.

Example

>>> import numpy as np
>>> rng = np.random.default_rng(5)
>>> n = 240
>>> pattern = np.tile([1.5, -0.5, -1.5, 0.5], n // 4)
>>> y = np.cumsum(0.1 * rng.standard_normal(n)) + pattern + 0.3 * rng.standard_normal(n)
>>> res = UnobservedComponents(y, seasonal=4).fit()
>>> bool(np.corrcoef(res.seasonal, pattern)[0, 1] > 0.99)
True