Holt-Winters

Learn how to use Holt-Winters exponential smoothing for forecasting.

Understanding Holt-Winters

Past data is compressed using exponential smoothing via the Holt-Winters method to anticipate typical values for the present and the future. Exponential smoothing means smoothing a time series using an exponentially weighted moving average (EWMA). Like a rolling mean, it can be used on past data to make it smoother but also to make forecasts for future values.

An exponentially weighted moving average FtF_t is calculated as Ft=αxt+(1α)Ft1F_t = \alpha x_t + (1-\alpha) F_{t-1} for an additive model and as Ft=αxt(1α)Ft1F_t = \alpha x_t (1-\alpha) F_{t-1} for a multiplicative model in which α\alpha is a smoothing constant.

The Holt-Winters method includes both a slope smoothing component to take the trend into account and a seasonal smoothing. So the model gets three equations—one for the level, one for the trend, and one for seasonality. Furthermore, each of these three equations has two versions—additive and multiplicative.

  • Level

    • Additive: t=α(ytstm)+(1α)(t1+bt1)\ell_t = \alpha (y_t-s_{t-m}) + (1-\alpha) (\ell_{t-1} +b_{t-1})

    • Multiplicative: t=αytstm+(1α)(t1+bt1)\ell_{t} = \alpha \frac{y_{t}}{s_{t-m}} + (1 - \alpha)(\ell_{t-1} + b_{t-1})

  • Trend

    • Additive: bt=β(tt1)+(1β)bt1b_t = \beta (\ell_t-\ell_{t-1})+(1-\beta )b_{t-1}

    • Multiplicative: bt=β(tt1)+(1β)bt1b_{t} = \beta(\ell_{t}-\ell_{t-1}) + (1 - \beta)b_{t-1}

  • Seasonality

    • Additive: st=γ(ytt1bt1)+(1γ)stms_t=\gamma(y_t-\ell_{t-1}-b_{t-1})+(1-\gamma)s_{t-m}

    • Multiplicative: st=γyt(t1+bt1)+(1γ)stms_{t} = \gamma \frac{y_{t}}{(\ell_{t-1} + b_{t-1})} + (1 - \gamma)s_{t-m}

Where mm is the seasonality of the series (for instance, 1212 for monthly data), yty_t is our target variable at time tt, and α,β\alpha, \beta and γ\gamma are smoothing parameters to be estimated from the data by our model.

Forecasting with Holt-Winters

In Python, Holt-Winters models are available in the statsmodels package.

Get hands-on with 1400+ tech skills courses.