Lesson 1 - Trend, Seasonality, and Residual
Welcome to Trend, Seasonality, and Residual
Module 1 called Cyclepath’s shape “an upward trend plus yearly seasonality” without pinning down what those words mean precisely. Now you will. A time series is rarely one signal — it’s usually two or three signals added or multiplied together, and decomposition is the act of pulling them back apart. Once you can see trend, seasonality, and residual as separate, nameable things, half the rest of this course is just deciding what to do with each piece on its own.
By the end of this lesson, you will be able to:
- Define trend, seasonality, and residual, and tell them apart on sight
- State the additive and multiplicative decomposition equations and when each applies
- Explain why decomposition comes before modeling, not after
- Preview how this module will build a decomposition by hand and then with a library
Let’s name the three pieces.
The Three Components
Every classical decomposition splits a series y into three components:
- Trend (T) — the slow-moving, long-run direction of the series, with the seasonal wiggle and the noise smoothed away. Cyclepath’s trend is a steady climb as the bike network grows; on other series a trend might be flat, falling, or curved.
- Seasonality (S) — a pattern that repeats on a fixed, known calendar cycle: every 12 months for Cyclepath, every 7 days for a series with a weekly pattern, every 24 hours for one with a daily pattern. Seasonality is not “any repeating wiggle” — it’s specifically tied to the calendar, which is what makes it predictable rather than merely observed.
- Residual (R), also called the remainder or irregular component — everything left over after trend and seasonality are removed. In a good decomposition the residual looks like unstructured noise: no visible pattern, no trend, no seasonality of its own. If the residual still has a shape to it, the decomposition missed something.
Notice the checks built into that picture: the trend panel has no wiggle left in it, the seasonal panel has no drift left in it, and the residual panel has neither — just noise. That’s what a decomposition is for: each component should contain only the kind of structure its name promises, and nothing else.
How the Pieces Combine
There are two standard ways to recombine the three components back into the observed series, and the difference matters more than it looks:
- Additive:
y = T + S + R. The seasonal swing is a constant amount — Cyclepath’s summer peak is roughly 3,200 trips above the trend line every year, whether the trend is at 10,000 or 16,000. - Multiplicative:
y = T × S × R. The seasonal swing is a constant percentage of the trend — a series where the summer peak is always “about 25% above the current level,” so the absolute swing grows as the level grows.
Both are legitimate models; which one fits depends entirely on whether the seasonal swing you observe stays a fixed size or scales with the level. Guessing wrong doesn’t just look slightly off — it produces a residual that still has a pattern in it (usually one that grows or shrinks over time), which defeats the entire point of decomposing in the first place. Lesson 3 makes this choice rigorously, on real data, with real evidence.
Why bother decomposing at all?
Decomposition isn’t a detour before “real” forecasting — it’s diagnostic infrastructure the rest of the course leans on directly. The trend component tells you if the series needs differencing (Module 3). The seasonal component tells you the seasonal order to configure in SARIMA (Module 6). The residual component is what’s left for a model to actually predict once the predictable structure is removed — and if it’s not noise-like, that’s a signal your model is missing something. Every technique from here forward either builds a component or reacts to one.
What’s Ahead in This Module
This module builds decomposition in three passes, each more sophisticated than the last:
- By hand (Lesson 2) — a centered moving average estimates the trend, subtracting it exposes the seasonal shape, and what’s left is the residual. No library required; you’ll see exactly what a decomposition function does internally.
- Additive vs. multiplicative, formalized (Lesson 3) — a rigorous test for which combination rule fits a given series, applied to Cyclepath and to a contrasting example where the swing genuinely grows.
- STL (Lesson 4) — a more robust decomposition method that handles outliers and slowly changing seasonality better than the classical moving-average approach, and is what most practitioners reach for today.
The module capstone (Lesson 5) applies all three to the full Cyclepath series and interprets what each component reveals.
Practice Exercises
Exercise 1: Name the component
A retailer’s daily sales series has a steady rise every December (holiday shopping) that repeats every year at the same time, on top of a gentle year-over-year growth as the store gains customers. Which part is trend and which is seasonality?
Hint
The gentle year-over-year growth is the trend — slow, long-run, no fixed calendar tie. The December spike that repeats every year at the same time is seasonality — it’s tied to a fixed calendar cycle (once per year, same month), which is exactly the definition. If the December spike grew or shrank unpredictably from one year to the next with no calendar regularity, it would not qualify as seasonal.
Exercise 2: Spot the bad residual
You decompose a series and plot the residual. Instead of unstructured noise, it clearly still rises and falls every 12 months, just with smaller swings than the original series. What does that tell you?
Hint
A residual with a leftover 12-month wave means the decomposition under-removed the seasonality — the seasonal component you subtracted wasn’t the full story. This commonly happens when the wrong combination rule is used (e.g., additive on a series that’s actually multiplicative), when the seasonal period is set incorrectly, or when the seasonal pattern itself is drifting over time faster than a simple decomposition can track. A clean residual is the sanity check that a decomposition succeeded; a patterned one tells you to reconsider your assumptions.
Exercise 3: Additive or multiplicative?
Two series both have a rising trend and a yearly peak. Series A’s peak is 500 units above trend every year, no matter how high the trend has climbed. Series B’s peak is always about 20% above whatever the trend currently is. Which is additive and which is multiplicative?
Hint
Series A is additive — the swing is a fixed amount (500 units) that doesn’t scale with the level, matching y = T + S + R. Series B is multiplicative — the swing is a fixed percentage (20%) of the current level, so the absolute swing grows as the trend grows, matching y = T × S × R. This is exactly the diagnostic Lesson 3 formalizes with real numbers.
Summary
Decomposition splits an observed series y into three named components. Trend (T) is the slow-moving long-run direction with seasonality and noise smoothed away. Seasonality (S) is a pattern tied to a fixed calendar cycle — not just any repeating wiggle. Residual (R) is whatever is left over, and in a good decomposition it looks like unstructured noise. The pieces recombine either additively (y = T + S + R, constant-size seasonal swing) or multiplicatively (y = T × S × R, seasonal swing scales with the level) — picking the wrong one leaves a patterned residual, which is exactly the tell that something’s off. This module builds a decomposition by hand, formalizes the additive-vs-multiplicative choice, and introduces STL, before applying all three to the full Cyclepath series.
Key Concepts
- Trend — the slow-moving long-run direction, with seasonality and noise removed.
- Seasonality — a pattern repeating on a fixed calendar cycle, not any repeating wiggle.
- Residual — whatever’s left after removing trend and seasonality; should look like noise.
- Additive vs. multiplicative — whether the seasonal swing is a constant amount or a constant percentage of the level.
Why This Matters
Every technique later in this course either builds one of these three components or reacts to one. Differencing (Module 3) is a way of removing trend. SARIMA’s seasonal order (Module 6) is a formal model of the seasonal component. And the residual is, in a very real sense, the thing every forecasting model is ultimately trying to shrink to pure noise — the smaller and less structured it gets, the less is left to explain. Learning to name and separate these three pieces now is what makes every later diagnostic (“does this need differencing?”, “is the seasonal order right?”, “did the model miss something?”) a question you can actually answer by looking at a plot.
Next Steps
Continue to Lesson 2 - Classical Decomposition by Hand
Estimate trend with a centered moving average, then extract the seasonal and residual components — no library required.
Back to Module Overview
Return to the Components and Decomposition module overview
Continue Building Your Skills
You now have precise definitions for trend, seasonality, and residual, and you know the two ways they combine. Next you’ll build a decomposition from scratch on the real Cyclepath series — a centered moving average for the trend, subtraction to expose the season, and whatever’s left as the residual — so you see exactly what a decomposition function does before you ever call one.