# Holt-Winters

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

We'll cover the following

## 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 $F_t$ is calculated as $F_t = \alpha x_t + (1-\alpha) F_{t-1}$ for an additive model and as $F_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: $\ell_t = \alpha (y_t-s_{t-m}) + (1-\alpha) (\ell_{t-1} +b_{t-1})$

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

• Trend

• Additive: $b_t = \beta (\ell_t-\ell_{t-1})+(1-\beta )b_{t-1}$

• Multiplicative: $b_{t} = \beta(\ell_{t}-\ell_{t-1}) + (1 - \beta)b_{t-1}$

• Seasonality

• Additive: $s_t=\gamma(y_t-\ell_{t-1}-b_{t-1})+(1-\gamma)s_{t-m}$

• Multiplicative: $s_{t} = \gamma \frac{y_{t}}{(\ell_{t-1} + b_{t-1})} + (1 - \gamma)s_{t-m}$

Where $m$ is the seasonality of the series (for instance, $12$ for monthly data), $y_t$ is our target variable at time $t$, 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 1200+ tech skills courses.