Time series decomposition: trend, seasonal indices, forecast
Decomposition splits a time series into a trend, a seasonal pattern that repeats every period (every 12 months, every 4 quarters, every 7 days) and an irregular part that is left over. It answers questions such as "how much higher is the fourth quarter than average?" and "is demand really growing once the season is taken out?". Putting the trend and the seasonal indices back together gives a forecast.
When to use it
- A time series plot shows a pattern that repeats with a known period, plus a trend.
- You want seasonal indices to plan staffing, inventory or maintenance windows.
- You want a seasonally adjusted series to see whether growth is real or just a busy season.
- You need a simple, explainable forecast for a seasonal series.
If the series has no seasons, trend analysis is enough. If the trend or the seasonal pattern changes over time, Winters' method adapts better, because it updates them period by period.
How it works
First choose the form. In the additive model the seasonal effect is a fixed amount; in the multiplicative model it is a fixed percentage, so the swings grow as the level grows:
Additive: yₜ = Trendₜ + Seasonalₜ + Irregularₜ
Multiplicative: yₜ = Trendₜ × Seasonalₜ × IrregularₜThis article uses the classical method, in five steps (multiplicative version, period L = 4):
- Centered moving average. Average one full period around each point to remove the season. For an even period, a 2 × 4 average centers it:
CMAₜ = (0.5·yₜ₋₂ + yₜ₋₁ + yₜ + yₜ₊₁ + 0.5·yₜ₊₂) / 4- Ratios. Divide each value by its CMA (for the additive model, subtract instead).
- Seasonal indices. Average the ratios for each season, then rescale them so they average exactly 1 (for the additive model, so they sum to 0).
- Trend. Divide the data by the indices to get the seasonally adjusted series, and fit a straight line to it.
- Fits and forecasts. Multiply the trend line by the index of each season.
Other variants use the median of the ratios or fit the trend before the moving average; they give slightly different indices.
Example
A maker of heating-system circulator pumps ships most units before winter. Quarterly shipments for five years:
| Year | Q1 | Q2 | Q3 | Q4 |
|---|---|---|---|---|
| 1 | 833 | 978 | 1101 | 1399 |
| 2 | 945 | 1076 | 1191 | 1640 |
| 3 | 1027 | 1180 | 1331 | 1797 |
| 4 | 1087 | 1272 | 1429 | 1959 |
| 5 | 1209 | 1374 | 1533 | 2064 |
The gap between Q4 and Q1 grows from 566 units in year 1 to 855 in year 5, so the seasonal effect grows with the level: a multiplicative model fits.
The first centered moving average is at Q3 of year 1: (0.5·833 + 978 + 1101 + 1399 + 0.5·945) / 4 = 1091.75, and the ratio is 1101 / 1091.75 = 1.008. The Q1 ratios over the years are 0.828, 0.804, 0.785 and 0.803, with an average of 0.805. After rescaling, the seasonal indices are:
Q4 runs 30% above the trend and Q1 runs 19% below it. Dividing by the indices and fitting a line gives the trend:
Trendₜ = 1013.82 + 28.716·tThe seasonally adjusted series climbs steadily, about 29 pumps per quarter:
The multiplicative fit has MAPE 1.13%, MAD 15.1 and MSD 493. The additive version, with seasonal effects of −257.0, −132.7, −11.0 and +400.7 pumps, does clearly worse: MAPE 2.61%, MAD 34.1 and MSD 2087, because a fixed Q4 bump is too small for recent years and too large for early ones.
Forecasts for year 6 are the trend at t = 21 to 24 times each index: 1302.3, 1482.7, 1657.7 and 2219.8 pumps. For Q1: (1013.82 + 28.716 × 21) × 0.8054 = 1302.3.
How to read the results
- Seasonal indices read as percentages of the trend: 1.3035 means 30% above the trend level for that quarter.
- The seasonally adjusted series shows the underlying direction. A drop in the raw data that disappears after adjustment is just the season.
- The trend slope is growth per period with the season removed.
- The irregular part (data divided by trend × season) should look like random noise. A pattern in it, or autocorrelation, means something the model misses.
Common mistakes
- Choosing additive when the swings grow. Compare the seasonal range at the start and the end of the series; if it grows with the level, use multiplicative.
- Too few cycles. Two years of monthly data give only one or two ratios per month, so each index rests on very little.
- Using the wrong period. The period must match the real cycle: 4 for quarters, 12 for months, 7 for days of the week.
- Extrapolating the straight trend too far. The forecast assumes the trend line and the seasonal pattern stay the same.
Frequently asked questions
Additive or multiplicative: how do I decide?
Look at the plot. If the peaks and troughs keep the same size as the level rises, use additive; if they grow in proportion, use multiplicative. When in doubt, fit both and compare MAPE, MAD and MSD, as in the example.
Why do the seasonal indices have to average 1?
So the seasons only move volume between quarters and do not change the yearly total. Without rescaling, the raw averages here (0.8051, 0.9006, 0.9897 and 1.3029) average slightly below 1 and would shift every forecast down a little.
Why does the moving average lose points at each end?
A centered average needs half a period on each side, so the first two and last two quarters have no CMA here. Their seasonal ratios come from the other years.
How is decomposition different from Winters' method?
Decomposition fits one trend and one fixed set of indices to the whole history. Winters' method updates the level, trend and seasonal factors every period, so it follows changes but needs smoothing weights.