Patterns › Time series

Classical / STL decomposition

Decomposes a seasonal time series into trend + seasonal + residual components. Classical (moving-average) or STL (Loess-based).

What is Classical / STL decomposition?

Decomposition separates the systematic structure of a series from the noise. Classical decomposition uses centred moving averages for the trend and per-period means (after detrending) for the seasonal; STL uses Loess smoothing for both, giving a more flexible decomposition that handles changing seasonal patterns.

Three components: trend (long-run movement), seasonal (period-by-period pattern), residual (everything else). Additive decomposition assumes constant seasonal amplitude; multiplicative assumes amplitude grows with trend.

When should I use Classical / STL decomposition?

  • Visualising seasonal data (monthly sales, daily traffic) before forecasting.
  • Detrending / deseasonalising before any modelling step.
  • STL specifically when the seasonal pattern changes over time.

What data does it need?

Numeric series + period (e.g. 12 for monthly, 7 for daily-with-weekly-cycle) + decomposition type (additive / multiplicative).

What does it report?

Trend / seasonal / residual arrays + variance share of each.

What does it assume?

  • Period correctly specified.
  • Enough data for at least 2 full periods.
  • Additive vs multiplicative chosen correctly (additive when seasonal swings are constant; multiplicative when they scale with the level).

How do I interpret the result?

Residual variance share substantially below 1 ⇒ the series has identifiable structure; close to 1 ⇒ mostly noise.

See also