Skip to content
Tutorials Center
My learning

Topics

Lesson 18 of 40 ยท Smoothing and Exponential Methods

The Holt-Winters Seasonal Method

Forecast seasonal data with Holt-Winters: additive and multiplicative seasonality, the gamma parameter, damped trend, statsmodels ExponentialSmoothing and choosing between variants.

Most business series have both a trend and a seasonal pattern: sales that grow year over year with a December peak, electricity use that climbs with a summer wave. Holt-Winters adds a third smoothed component, the seasonal indices, to Holt's method. It is one of the best-known forecasting methods and often hard to beat for monthly and quarterly data.

Three components, three parameters

Holt-Winters keeps a level l, a trend b and m seasonal values s (one per position of the seasonal cycle, m = 12 for monthly data). Each has its own smoothing parameter: alpha for the level, beta for the trend, gamma for the season.

Additive version (constant seasonal swings):

  • Level: l(t) = alpha * (y(t) - s(t-m)) + (1 - alpha) * (l(t-1) + b(t-1))
  • Trend: b(t) = beta * (l(t) - l(t-1)) + (1 - beta) * b(t-1)
  • Season: s(t) = gamma * (y(t) - l(t-1) - b(t-1)) + (1 - gamma) * s(t-m)
  • Forecast: yhat(t+h) = l(t) + h*b(t) + s(t+h-m)

Multiplicative version (swings proportional to the level): replace subtraction with division in the level and season updates and multiply in the forecast: yhat = (l + h*b) * s.

Holt-Winters components

Level alpha, current base value.
Trend beta, change per period.
Season gamma, one index per position.

Each part is smoothed with its own parameter.

1 / 2

Fitting with statsmodels

Use ExponentialSmoothing and choose trend and seasonal as "add", "mul" or None, plus seasonal_periods.

Python Holt-Winters additive on monthly data

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 reproduces both the upward drift and the yearly wave. Parameters near 0 for gamma mean the seasonal pattern is very stable.

Additive versus multiplicative seasonality

Choose with the same test as in decomposition: do seasonal swings grow with the level? If yes use seasonal="mul" (needs positive data).

Python Multiplicative seasonality on growing swings

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.

With growing swings the multiplicative model gives clearly lower error. As an alternative, log-transform the data and use the additive model; see transformations.

Damping the trend

Combine the seasonal terms with a damped trend (damped_trend=True). This is a very common winner in forecasting competitions because it keeps the long-run trend from exploding.

Python Comparing four Holt-Winters variants

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 data have a curve that is slowing, so damping or dropping the trend beats a straight trend. Compare candidates on held-out data, not only AICc.

Requirements and pitfalls

  • You need at least two full seasons of data; more is better for stable seasonal estimates.
  • seasonal_periods must be set when the index has no frequency.
  • The multiplicative seasonal needs strictly positive data.
  • Only one seasonal period is supported. For hourly data with daily and weekly cycles use Fourier terms or TBATS-style models.
  • The optimiser can land on odd parameter values (for example alpha at 1); look at the parameters and the forecast plot.
  • For a large m (365) the number of seasonal states makes the model slow and unstable; use Fourier regression instead.

Prediction intervals

ExponentialSmoothing does not return intervals directly. Two practical options: use ETSModel (next lesson), which has proper state-space intervals, or simulate with fit.simulate(...) and take quantiles.

Python Simulation-based forecast intervals

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.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. Holt-Winters has three smoothing parameters. Which one controls the seasonal indices?

    alpha is for the level, beta for the trend and gamma for the seasonal component.
  2. 2. Seasonal swings grow as the series grows. Which setting do you use?

    Multiplicative seasonality scales the swing with the level.
  3. 3. What is the minimum amount of data Holt-Winters needs?

    Seasonal indices need at least a couple of complete cycles to be estimated.
  4. 4. Which is a limitation of the standard Holt-Winters method?

    Multiple seasonalities (such as daily and weekly) need other approaches.

Summary

  • Holt-Winters = level + trend + seasonal indices, with parameters alpha, beta, gamma.
  • Additive for constant swings, multiplicative when swings scale with the level.
  • ExponentialSmoothing(y, trend, seasonal, seasonal_periods) fits it; add damped_trend=True for robustness.
  • Needs at least two seasons; supports one seasonal period.
  • Use simulate or ETSModel for prediction intervals.

Next: ETS State-Space Models