learn-timeseries-forecasting-with-phoebe / Builder session 3 of 10
Learn Timeseries Forecasting with Phoebe · Builder track · Session 3 of 10

Exponential smoothing: a weighted memory of the past

The first real forecasters on the ladder. Exponential smoothing says the recent past matters more than the distant past, and weights it so. This session builds the ETS family - simple smoothing, Holt's trend, and Holt-Winters seasonality - in real statsmodels on the Lumen series, and hands you a live forecaster where you switch method and horizon and watch the error move.

🟢 Builder track Practitioners: analysts · data scientists · engineers Python 3.10+ · statsmodels 45 minutes
0-3 · Recap 3-18 · Smoothing, trend, seasonality 18-42 · Build-along + the live forecaster 42-45 · Q&A
Part 0

From baselines to a real model

In b2 you shipped the baselines - naive, drift, seasonal-naive - and decomposed the Lumen series. Tonight you climb one rung: exponential smoothing, the family that quietly powers a huge share of real business forecasts because it is fast, robust, and needs little data. You will build all three members (level, then trend, then seasonality) and, at the end, drive a live forecaster that computes their accuracy in front of you.

Live - presented in session Self-study - read after class ★ Run it now (Python) Sources covered (cited)
★ What you walk out with today The three ETS models built in statsmodels on Lumen, an intuition for the smoothing parameters (alpha, beta, gamma) as "how fast the model forgets", a prediction interval on every forecast, and a live in-browser forecaster that shows why seasonality-aware smoothing beats the flat baseline.
Part 1 · covers FPP3 ch.8

Recent past matters more 6 min live

A moving average treats the last 7 days as equally important and everything older as worthless. Exponential smoothing is smarter: every past point counts, but its weight decays geometrically as it recedes. One parameter, alpha, sets how fast the memory fades - high alpha reacts quickly, low alpha is steady.

Weight given to each past day (alpha = 0.4) 40% 24% 14% 9% 5% today ← older alpha high = fast memory, reacts to recent change. alpha low = long memory, steady, ignores blips. The weights sum to 1 and decay by (1 - alpha) each step back. Nothing is thrown away; old news just fades.
🔍 Click to zoom - geometrically decaying weights are the whole idea
LiveThe three members of the ETS family3 min▶

You add one component at a time:

  • Simple exponential smoothing (SES) - tracks the level only. Good for a flat, trendless, seasonless series. One parameter: alpha.
  • Holt's linear trend - adds a smoothed trend term (beta). Now the forecast can slope up or down instead of going flat.
  • Holt-Winters - adds a smoothed seasonal term (gamma). This is the one that captures Lumen's weekly rhythm - and the one that wins on this data.
Real world

ETS is the workhorse. Exponential smoothing is often the quiet default in retail and operations forecasting: it needs little data, trains in milliseconds, and is hard to beat on short horizons. Many teams ship Holt-Winters and only reach for ARIMA or ML when a backtest proves it earns its keep.

Part 2 · covers FPP3 ch.8

Level, trend, and season, each updated 5 min live

Holt-Winters keeps three running estimates and nudges each one every day: the level (where we are), the trend (how fast we are moving), and the seasonal offsets (the repeating weekly shape). The forecast is simply level + horizon x trend + the right seasonal offset.

Level (alpha) where we are now smoothed current value + Trend (beta) how fast we move slope per step + Season (gamma) weekly offsets 7 repeating deltas = Forecast level + h·trend + season[weekday] Each day, all three are nudged toward the newest observation. The parameters set how fast each one adapts. Additive when the seasonal swing is roughly constant; multiplicative when it grows with the level.
🔍 Click to zoom - Holt-Winters = level + trend + season
Self-studyBuild all three in statsmodels2 min read▶

statsmodels' ExponentialSmoothing covers the whole family - you just switch trend and seasonal on:

★ Run it now (Python) - SES, Holt, Holt-Wintersimport numpy as np, pandas as pd from statsmodels.tsa.holtwinters import SimpleExpSmoothing, ExponentialSmoothing # train/test from b1 (Lumen daily sessions), H = 14 # 1) Simple exponential smoothing - level only ses = SimpleExpSmoothing(train).fit() # 2) Holt - level + trend holt = ExponentialSmoothing(train, trend="add").fit() # 3) Holt-Winters - level + trend + weekly seasonality hw = ExponentialSmoothing(train, trend="add", seasonal="add", seasonal_periods=7).fit() for name, model in [("SES", ses), ("Holt", holt), ("Holt-Winters", hw)]: fc = model.forecast(len(test)) mape = (np.abs(test.values - fc.values) / test.values).mean() * 100 print(f"{name:13s} MAPE: {mape:5.2f}%") # HW wins on seasonal data

On the Lumen series the ranking is unambiguous: Holt-Winters, which alone captures the weekly season, posts the lowest error.

Demo · drive it yourself

The live forecaster ★ real math in your browser

This is a genuine forecaster, not a mock-up. It computes moving-average, exponential-smoothing, seasonal-naive, and Holt-Winters forecasts on a synthetic Lumen series right here, draws an 80% prediction interval, and scores each on a held-out horizon. Switch the method and the horizon, and watch the MAPE move. Notice the two methods that capture the weekly pattern - seasonal-naive and Holt-Winters - leave the flat baseline far behind.

Read the interval, not just the line A forecast without a prediction interval is a guess with false confidence. See how the green band widens the further out you forecast - uncertainty compounds with the horizon. Reporting that band is as much your job as the point forecast.
Build-along

Forecast Lumen with a prediction interval ★ 8 min · build your own

Fit Holt-Winters and report the interval, not just the point.

Fit ExponentialSmoothing with additive trend and 7-day seasonality on the train set.

Forecast the horizon and pull a prediction interval from the model's residual spread.

Score MAPE on the holdout and compare it to the seasonal-naive baseline from b1.

★ Run it now (Python) - Holt-Winters + 80% intervalimport numpy as np from statsmodels.tsa.holtwinters import ExponentialSmoothing hw = ExponentialSmoothing(train, trend="add", seasonal="add", seasonal_periods=7).fit() fc = hw.forecast(len(test)) # an 80% interval from the in-sample residual spread, widening with horizon resid = train - hw.fittedvalues sigma = resid.std() z = 1.28 steps = np.arange(1, len(test) + 1) lo = fc - z * sigma * np.sqrt(steps) hi = fc + z * sigma * np.sqrt(steps) mape = (np.abs(test.values - fc.values) / test.values).mean() * 100 print(f"Holt-Winters MAPE: {mape:.2f}% (beat seasonal-naive from b1?)") print("interval widens with horizon:", round(hi.iloc[0]-lo.iloc[0]), "->", round(hi.iloc[-1]-lo.iloc[-1]))
Real world

Simple, but not naive. Exponential smoothing has a formal statistical form (the ETS state-space models in FPP3) that produces principled prediction intervals and can auto-select the best trend/season combination. That is why it remains a first-line production method - you get calibrated uncertainty almost for free.

Homework

Try it yourself - this week ◐ 30-45 min total

Source material

Sources covered (cited)

Taught from the forecasting canon. This session covers:

✓Forecasting: Principles and Practice, 3rd ed - ch.8 exponential smoothing (Hyndman & Athanasopoulos)Parts 1-2 · SES, Holt, Holt-Winters, ETS state-space intervals
◐M-competitions (Makridakis)Demo · why smoothing remains a strong first-line method
Check yourself

Three questions before you go 🎯 ◐ 90 seconds

1 · What does the alpha parameter in exponential smoothing control?

Alpha sets the decay of the weights. High alpha weights the recent past heavily (twitchy); low alpha spreads weight further back (steady).

2 · Which ETS member captures a weekly pattern?

SES tracks level only; Holt adds trend; Holt-Winters adds the seasonal term (gamma) that models the repeating weekly offsets.

3 · Why report a prediction interval with the forecast?

Forecasts are uncertain. The interval communicates that honestly, and it should widen further out because uncertainty compounds with the horizon.

Builder session 3 cheat sheet · pin this

Exponential smoothingevery past point counts, weighted by geometric decay. Nothing is thrown away; old news fades.
alpha / beta / gammasmooth the level / trend / season. Each sets how fast that component adapts.
SESlevel only. Flat, trendless, seasonless series.
Holtlevel + trend. Forecast can slope.
Holt-Winterslevel + trend + season. Captures the weekly rhythm - wins on Lumen.
Additive vs multiplicativeadditive when the seasonal swing is constant; multiplicative when it grows with the level.
Always an intervalreport the 80% band, and expect it to widen with the horizon.
Next sessionb4 - ARIMA / SARIMA: stationarity, differencing, ACF/PACF, and model orders.