Pull up the monthly sales of a coffee chain over five years and you will not see a single trend — you will see several patterns tangled together. Sales drift upward year on year as the brand grows. They spike every December and sag every summer. Some years the whole economy runs hot or cold, dragging everything with it. And on top of all that sits a layer of unpredictable jitter. A time series is almost never one story; it is a sum of stories, and the first job of time-series analysis is to pull them apart.
Do that cleanly and the forecast, the anomaly alarm and the "is this year really better?" question all become tractable. Leave them tangled and every model you fit will be confused.
The classical decomposition splits a series
They combine in one of two ways. An additive model,
The curve below is a synthetic monthly series built from exactly two ingredients — a gentle upward
trend and a repeating annual wave:
The straight dashed line is the trend alone; the wavy curve is trend + seasonality. The vertical gap between them at any point is the seasonal contribution — here a fixed-amplitude wave, the hallmark of an additive series.
What makes time series special is that neighbouring points are not independent — today's value
is a good clue to tomorrow's. We measure that self-similarity with autocorrelation:
the ordinary
Plot the autocorrelation at every lag and you get the ACF (autocorrelation function). It is a fingerprint: a slow, gradual decay signals a strong trend; a spike that recurs every 12 lags in monthly data screams "annual seasonality." Reading an ACF tells you which components are present before you fit anything.
Most classical forecasting models assume the series is stationary — its statistical character does not drift over time. Concretely: constant mean, constant variance, and an autocorrelation that depends only on the lag, not on when you look. A stationary series has no trend and no seasonality; it looks the same in 2020 as in 2025.
Why insist on this? Because a model learns a relationship from the past and projects it forward — and that is only valid if the relationship is stable. A trending series breaks the assumption: its mean is a moving target, so any correlation you measure is dominated by the shared drift (the same spurious-correlation trap that makes two unrelated rising series look linked).
The cure is differencing: instead of modelling
The number of Nobel laureates a country produces and its chocolate consumption are famously correlated — not because chocolate makes you brilliant, but because both have risen over time alongside national wealth. Any two series that trend upward will correlate strongly, however unrelated, because the shared drift dominates the arithmetic. This is the time-series face of confounding, and it is exactly why we difference: comparing the year-to-year changes strips out the common trend and reveals whether the two things actually move together once the tide is removed. Correlate levels and you fool yourself; correlate changes and you have a fighting chance.
Beginners lump "seasonality" and "cyclical" together, but the distinction is sharp and it matters. Seasonality has a fixed, known period — 12 months, 7 days, 24 hours — so you can put a confident marker on next December before it arrives. A cycle has no fixed period: the business cycle averages maybe five years but the next recession could be in two years or eight, and its timing is genuinely uncertain. That difference decides your model: seasonal patterns are predictable and get a dedicated seasonal term; cyclical swings are largely unpredictable and mostly widen your forecast's uncertainty bands. Calling a cycle "seasonal" will make you dangerously overconfident about when the next turn comes.
Kaggle Learn's Time Series course walks through trend and seasonality decomposition, lag features and autocorrelation on real forecasting datasets in Python — the natural place to see these components extracted and plotted with pandas and statsmodels.