Skip to content
Tutorials Center
My learning

Topics

Lesson 16 of 40 ยท Smoothing and Exponential Methods

Simple Exponential Smoothing

Forecast level-only series with simple exponential smoothing: the recursion by hand, the smoothing parameter alpha, optimising it with statsmodels, and when SES fails.

Exponential smoothing is a family of forecasting methods built on one clear idea: recent observations matter more than old ones, and the weights fade smoothly. Forecasts from these methods have been competitive for decades, they are cheap to compute, and they run reliably on thousands of series at once.

This lesson covers the simplest member, simple exponential smoothing (SES), which is meant for series with no trend and no seasonality: the data wander around a level that changes slowly.

The idea in one equation

Keep a running estimate of the level l(t). Each time a new observation arrives, move the level a fraction alpha of the way toward it:

l(t) = alpha * y(t) + (1 - alpha) * l(t-1)

The forecast for every future step is the latest level:

yhat(t+h) = l(t) for all h >= 1

So SES forecasts a flat line. Unrolling the recursion shows that the weights on past observations are alpha, alpha(1-alpha), alpha(1-alpha)^2, ... a geometric decay, hence the name.

Simple exponential smoothing

New observation Pull the level toward it.
Alpha Between 0 and 1.
Flat forecast Same value for every horizon.

Large alpha forgets fast, small alpha averages long.

1 / 2

The recursion by hand

Python SES from scratch

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

The newest value carries weight 0.5, the one before 0.25, then 0.125 and so on. The leftover weight (the tiny remainder) sits on the initial level.

Choosing alpha

alpha controls how fast the level reacts:

alpha Behaviour Equivalent window
near 1 (0.8-1.0) follows the data closely, noisy forecast about 1-2 points
0.3 balanced about 5-6 points
near 0 (0.05) very smooth, slow to adapt about 40 points

The "effective window" is about 2 / alpha - 1. For a noisy series with a stable level choose small alpha; when the level shifts often choose larger alpha.

Python Effect of alpha on a level shift

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Larger alpha adapts to the jump within a few steps but wobbles more beforehand; small alpha is calm yet slow to react. The best choice depends on your data, so let the computer estimate it.

Fitting with statsmodels

SimpleExpSmoothing estimates alpha (and the initial level) by minimising the one-step-ahead squared errors.

Python SimpleExpSmoothing: fit, forecast, compare with naive

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

SES sits between two extremes: the naive forecast (alpha = 1) and the overall mean (alpha = 0). The mean is far worse here because the level drifts; the naive forecast is about as good, since the estimated alpha is moderate. SES pays off most when observations are noisy around the level, because it averages the noise out. You can also fix alpha yourself with .fit(smoothing_level=0.3, optimized=False).

Prediction intervals and the error-correction form

SES can be written as l(t) = l(t-1) + alpha * e(t) where e(t) = y(t) - l(t-1) is the forecast error of the previous step. The level is corrected by a fraction of the last error. This form leads directly to the state-space view in ETS models, which also gives prediction intervals that widen with the horizon.

SES is also mathematically the same as an ARIMA(0, 1, 1) model with theta = alpha - 1, so it connects to moving-average models.

When SES is the wrong tool

  • A trend: the flat forecast lags behind; use Holt's method.
  • Seasonality: it is ignored; use Holt-Winters or deseasonalise first.
  • Intermittent demand (many zeros): consider Croston's method.
Python SES lags behind a trend

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

The forecast stays flat at about the last level while the true line keeps rising, so the error grows with the horizon.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. What does SES forecast for horizons 1, 2 and 3?

    SES has no trend or seasonal terms, so the forecast is a flat line at the last smoothed level.
  2. 2. What does alpha = 1 give?

    With alpha = 1 the level equals the latest observation.
  3. 3. A series is very noisy around a stable level. Which alpha is better?

    A small alpha averages over many observations and ignores noise.
  4. 4. SES is used on a series with a clear upward trend. What happens?

    A flat line cannot follow a rising series, so the gap grows with the horizon.

Summary

  • SES keeps a level updated by l = alpha*y + (1-alpha)*l_prev and forecasts it as a flat line.
  • Weights on past data decay geometrically; alpha sets the speed.
  • statsmodels estimates alpha by minimising squared one-step errors.
  • It beats naive and mean forecasts for slowly drifting levels but fails with trend or seasonality.
  • It equals ARIMA(0,1,1) and is the simplest ETS model.

Next: Holt's Linear Trend Method