Exponential Smoothing

P7.forecasting.02 · Audience: guest, it-ml, language-pro · Prerequisites: Baselines You Must Beat

The baselines set the bar; now comes the first real forecasting method. The moving average from the last module treated its window bluntly — the value from five days ago counted exactly as much as yesterday's, and everything older counted for nothing. Exponential smoothing replaces that cliff with a slope: every past value gets a vote, but the votes fade the further back you look. One dial controls how fast they fade — and two upgrades of the same idea carry it all the way to trending, seasonal series.

Step 1 / 5An average that forgets

Two extremes bracket the problem. Averaging all history gives a stiff forecast that barely moves when the series shifts — old data outvotes the news. The naive forecast is the other extreme: it listens only to yesterday and inherits every wiggle of the noise. What you want is in between — recent values should count most, older values should fade smoothly rather than fall off a cliff.

ⓘ Concept: Simple exponential smoothing (SES)
level(t)=αy(t)+(1α)level(t1)level(t) = α · y(t) + (1 − α) · level(t−1)

Why it matters — SES tracks a single quantity — the current level of the series — and updates it with each new observation. The smoothing parameter α (between 0 and 1) is the forgetting dial: α near 1 trusts the latest value and reacts fast like naive; α near 0 trusts the accumulated level and moves slowly like a long average. Weights on past values decay geometrically — exponentially — which gives the method its name.

🗣️ From a linguist's perspective: A conversation partner who forgets gracefully
An interpreter tracking a speaker's pace works exactly this way: the estimate of "how fast are they talking" leans mostly on the last few sentences, a little on the previous minute, and almost nothing on the start of the speech. Nobody recomputes an average over the whole talk, and nobody resets it on every sentence either. Exponential smoothing is that instinct written as one line of arithmetic.
Ask the mentor about this module

Ask a question about this content. The mentor explains and grounds its answer in what you are studying; asking is recorded as a learning signal, not a grade.

Ctrl/Cmd + Enter to send

Try it yourself

A scratch console for this page's ideas — ungraded, nothing you run here is recorded.

Scratch console

A scratch console with the scientific stack (pandas, numpy, scikit-learn). Runs on the server — no network, resource-limited and measured.

Output appears here.