Patterns › Time series

Structural time series (level / trend / seasonal)

Structural (state-space) time-series model decomposes a series into unobserved level, slope, and seasonal components with a Kalman filter, then forecasts ahead with a model-based prediction band.

What is Structural time series (level / trend / seasonal)?

Rather than differencing the series (as ARIMA does), a structural model writes it as a sum of unobserved components — a stochastic level, an optional slope (trend), and an optional dummy-variable seasonal — each driven by its own random shock. The variances of those shocks are estimated by Gaussian maximum likelihood via the Kalman filter's prediction-error decomposition; a state smoother then recovers the most likely path of each component over the whole sample.

A zero estimated variance is informative: it collapses a component to a deterministic form (e.g. a fixed slope or a constant seasonal pattern). Forecasts iterate the fitted state forward, and the prediction interval widens with the horizon as the accumulated component uncertainty compounds.

When should I use Structural time series (level / trend / seasonal)?

  • Extracting an interpretable trend + seasonal decomposition of a single series.
  • Forecasting when you want the level/slope/seasonal pieces exposed rather than folded into ARIMA coefficients.
  • Series with evolving (not fixed) seasonality or trend.

What data does it need?

One numeric series (row order = time) + model type (local level / local linear trend / basic structural) + seasonal period (for the seasonal model) + forecast horizon h + interval level.

What does it report?

Estimated component variances, log-likelihood and AIC, smoothed level/slope/seasonal component charts, and a history-plus-forecast fan chart with a table of point forecasts and bounds.

What does it assume?

  • Series is regularly spaced and time-ordered.
  • Component shocks are Gaussian and mutually independent.
  • The chosen seasonal period matches the data's cycle length.

How do I interpret the result?

The smoothed level (and slope) show the underlying trend with noise and season removed; the seasonal component shows the repeating pattern. A near-zero component variance means that piece is effectively deterministic over the sample.

Fit is by numerical optimization, so component variances match a reference state-space fit to practical precision (~1e-3); the log-likelihood and forecasts agree much more tightly.

See also

References

  • Harvey (1989). Forecasting, Structural Time Series Models and the Kalman Filter. Cambridge University Press.
  • Durbin & Koopman (2012). Time Series Analysis by State Space Methods, 2nd ed. Oxford University Press.