What You'll Learn
You'll learn how to use moving averages to systematically separate a time series into its trend and seasonal components—the classical decomposition approach.
The Core Idea
Classical decomposition is like untangling a braided rope: you take your time series data and methodically separate it into distinct strands—trend, seasonal, and irregular components—using moving averages as your primary tool.
The process works differently depending on whether you're using an additive or multiplicative model:
For Additive Models (Y = T + S + I)
-
Extract the Trend (T): Apply a moving average to smooth out the data. The window size typically matches the seasonal period (e.g., 12 months for monthly data with yearly seasonality). This gives you the trend component.
-
Detrend the Series: Subtract the trend from the original data:
Y - T. What remains contains seasonal and irregular components. -
Isolate Seasonality (S): Average the detrended values for each season (e.g., all Januaries, all Februaries). These averages become your seasonal indices.
-
Extract the Irregular (I): Subtract both trend and seasonal components from the original:
I = Y - T - S.
For Multiplicative Models (Y = T × S × I)
The process is similar, but you divide instead of subtract. Detrending becomes Y / T, and the final irregular component is I = Y / (T × S).
The Moving Average Choice
Centered moving averages work best—they look equally forward and backward, avoiding phase shifts that would misalign your seasonal pattern with the calendar.
Key Takeaway: Classical decomposition uses moving averages to sequentially peel apart trend, seasonal, and irregular components, with the mathematical operations (addition/subtraction or multiplication/division) matching your chosen model structure.