Exponential smoothing: from simple smoothing to Holt-Winters and ETS
Before this lesson: lesson 01 (level, trend, seasonal period , additive and multiplicative seasons) and lesson 03 (benchmarks, rolling origin, MASE). One-dimensional minimisation helps (optimization lesson 01). Time: about 75 minutes, plus the notebook.
Why this matters #
- It is used everywhere in operations. Inventory systems, demand planning and capacity
planning have used exponential smoothing since the 1950s (Brown, Holt, Winters). Spreadsheet
software has it built in: Excel's
FORECAST.ETSuses an additive ETS model. - It is a strong benchmark. In the M4 competition, the benchmark "Comb", the average of SES, Holt and damped trend forecasts, was more accurate than all six pure machine-learning methods (Makridakis et al. 2020). The Theta method, the winner of the M3 competition, is equivalent to SES with drift (Hyndman and Billah 2003).
- It is the simplest state-space model. Its update "state = prediction + gain × error" is the same structure as the Kalman filter (lesson 07), and SES is a special case of ARIMA (lesson 06). Recurrent neural networks (lesson 09) also carry a state forward and update it with each new value; the ES-RNN hybrid that won M4 combined Holt-Winters equations with an LSTM (Smyl 2020).
- Libraries:
statsmodels(ExponentialSmoothing,ETSModel),statsforecast(AutoETS), Rfable(ETS()) andforecast(ets()).
1. Predict first #
2. The picture #
An average with fading weights #
Take the last observed values . The SES forecast of the next value is
with . The weights shrink by the factor at each step back: they decay exponentially, hence the name. With the weights are : many past values matter. With they are : almost only the newest value matters.
Move . The bars are the weights of the last 20 observations; the yellow bar is the newest one. Above, the level (aqua) smooths the data (blue), and the forecast (orange) is a flat line from the origin. Small : long memory and a smooth level. : the level is the last value, and SES becomes the naive forecast.
State plus gain times error #
The same forecast can be computed with one number in memory, the level . When the new value arrives:
- the forecast was ;
- the error is ;
- move the level a fraction of the way: .
If the forecast was too low (), the level goes up; if it was right, nothing changes. Holt's and Winters' methods keep more states (a trend and seasonal states ) and update each of them with its own gain times the same error. Section 3.5 shows these updates step by step.
SES with . What weight does the forecast give to ?
The weight of is . Here (three steps before the newest value ), so it is . The value is the weight of : count from 0 for the newest value.
3. Definitions and main results #
3.1 Simple exponential smoothing: three equal forms #
Definition (SES). Choose and a starting level . For :
This is the component form. The forecast is flat: the same value for every horizon, because SES has no trend and no season.
Theorem (three equal forms). For every :
- error-correction form: with ;
- weighted-average form: , and the weights sum to 1.
Proof.
- .
- By induction on . For : , which is the formula. If the formula holds for , then . Put in the sum: it becomes . Adding the term (the case ) gives the formula for .
- The weights sum to (a geometric sum).
So SES is a weighted average of the data and , and the weight of dies out like .
Memory. The weights form a geometric distribution over the age . Its mean is . So the average age of the data in the forecast is steps, and roughly the last observations carry most of the weight. : about 10 observations; : about 2.
SES has fitted at the last observation. What is the forecast for ?
The SES forecast function is flat: for every . Without new data the level is never updated, so every future value gets the same forecast. To get a sloped forecast you need a trend state (Holt's method).
3.2 Choosing and #
The parameters are chosen to make the one-step errors small on the training data:
There is no closed-form minimiser, because depends on through all
earlier steps. But SSE is cheap to evaluate (one pass through the data), so a one-dimensional
search works: a grid over , then a bounded scalar minimiser such as golden
section or Brent's method (scipy.optimize.minimize_scalar). Libraries estimate together
with , or set it to or to the mean of the first few values.
What the minimiser finds depends on the data:
- white noise around a constant mean: the best forecast is the overall mean, so is close to 0 (average everything);
- a random walk: the best forecast is the last value, so is close to 1;
- a local level (a slowly wandering mean plus noise): is in between. For the model , with the ratio , the best is ; for this is about 0.27. Lesson 07 derives this formula as the steady-state Kalman gain.
Drag on the curve to move the current . The magenta curve is the SSE of the one-step errors and the orange dot is its minimum. Below, the level follows the data. Before you switch the series, guess where the minimum will be: white noise, random walk, local level.
3.3 Holt's linear trend and the damped trend #
Holt's linear trend method (Holt 1957) adds a trend state , the current slope:
with and . Read the level equation as "a weighted average of the new value and the previous level moved one step along the trend". The trend equation is "a weighted average of the newest change in level and the previous slope".
In error-correction form, with :
(For the trend: , so .)
The forecast is a straight line with slope . A straight line goes on forever, so at long horizons Holt's forecasts are often too high (or too low). The damped trend method (Gardner and McKenzie 1985) bends the line towards a flat one:
with . The sum is geometric: . As it tends to , so the forecast tends to the constant . With the method is Holt's method; with it is SES. In practice is restricted to (FPP3): below 0.8 the damping is very strong, and above 0.98 the method is almost Holt's. On many business series, damped trend is one of the most accurate single methods (Gardner 2006).
In the damped trend method you set . Which method do you get?
With the sum equals , and the level and trend equations become exactly Holt's. The forecast is the straight line , which does not level off. SES is the case (or ).
3.4 Holt-Winters: adding a season #
Winters (1960) added seasonal states with period . In the additive method the season is added; it has a fixed size:
Each line has a plain meaning:
- level: a weighted average of the seasonally adjusted value and the previous level moved along the trend;
- trend: as in Holt's method;
- season: a weighted average of the newest seasonal deviation and the seasonal state of the same season one period earlier, .
The seasonal index. There are seasonal states, one per season, and each one is updated once per period. The forecast for horizon uses the last updated state of the season of , which is . For this is ; for it is , the same state again. The integer counts the full periods inside the horizon, exactly as for the seasonal naive forecast of lesson 03.
The usual ranges are , and (FPP3, §8.6). With , the seasonal states never change: the seasonal pattern is frozen at its start values.
The multiplicative method is for swings that grow with the level. The season multiplies the level, and the seasonal states are ratios around 1 instead of deviations around 0:
| additive | multiplicative | |
|---|---|---|
| forecast | ||
| level | ||
| trend | the same | |
| season | ||
| seasonal states | sum to about 0 over one period | average about 1 over one period |
The damped versions replace by and by . A third option for growing swings: take logarithms (lesson 01) and use the additive method on .
Start values. The recursions need , and seasonal states before the first update. A simple rule, used in the figures and the notebook of this lesson, uses the first two periods. Let and be the means of the first and the second period. Then ; the level at the end of the first period is ; and the seasonal states are the first period's values minus the trend line, for (divide instead of subtract for the multiplicative method). The updates start at . Libraries usually estimate the start values together with the parameters.
Pick a model and move its parameters. The training data are the blue line, the test data the blue dots, and the forecast starts at the origin with its 95 % interval (orange band). "Fit" minimises the SSE of the one-step errors on the training part. Notice: SES is flat, Holt's line follows the last swing, damping bends the line, and only the Holt-Winters methods follow the season. Set to freeze the seasonal pattern. On the "growing swings" data compare the additive and the multiplicative method.
Monthly sales of a growing company: the difference between the December peak and the February low doubles when the sales level doubles. Which model fits best?
Seasonal swings that grow in proportion to the level are a multiplicative season: . Multiplicative Holt-Winters models this directly. Taking logs turns the product into a sum, so additive Holt-Winters on also works. The additive method assumes swings of a fixed size.
3.5 ETS: exponential smoothing as a state-space model #
So far exponential smoothing is a recipe: equations that produce point forecasts. To get a likelihood and prediction intervals we need a statistical model: a rule that says how the data are generated, including the randomness.
ETS(A,N,N): the model behind SES. Let be independent errors. The innovations state-space model is
The state is the one-step forecast, and is the one-step error of SES. So the model generates exactly the SES recursions: the point forecasts of ETS(A,N,N) are the SES forecasts. The same error drives both equations (one source of randomness); such errors are called innovations.
The name ETS. ETS stands for (Error, Trend, Seasonal), and also for "ExponenTial Smoothing". Each letter is a component:
- Error: A (additive) or M (multiplicative, );
- Trend: N (none), A (additive) or (additive damped);
- Seasonal: N, A or M.
So SES is ETS(A,N,N) or ETS(M,N,N); Holt is ETS(A,A,N); damped trend is ETS(A,,N); additive Holt-Winters is ETS(A,A,A); multiplicative Holt-Winters is ETS(M,A,M). There are combinations (FPP3, §8.5). Three of them, ETS(A,N,M), ETS(A,A,M) and ETS(A,,M), can be numerically unstable (they divide by states that can be close to 0), so automatic selection usually skips them (FPP3, §8.6). Additive and multiplicative errors give the same point forecasts but different intervals.
What the model adds.
- A likelihood. For additive errors, . Maximising over gives , and then maximising the likelihood is the same as minimising the SSE. For multiplicative errors the likelihood has an extra term, so the two criteria differ.
- Model selection. With a likelihood you can compare different models with the AIC,
(or the corrected AICc), where counts the parameters, the start values and
. Automatic ETS (
AutoETS,ets()) fits all allowed models and keeps the one with the smallest AICc. The SSE cannot do this: a model with more states always has a smaller SSE. - Prediction intervals. The model says how far the future can move. This needs the distribution of the future errors, derived next.
Theorem (ETS(A,N,N) forecast variance). For ETS(A,N,N), the -step forecast error has mean 0 and variance
Proof.
- Apply the state equation times: .
- The observation equation at time gives .
- The future errors are independent of the past and of each other, with mean 0. So the conditional mean is (the SES forecast), and the variance is .
A 95 % prediction interval is . With this is the naive forecast's from lesson 03; with small the interval grows slowly, because a single shock moves the level only a little.
The same argument works for every model with additive errors and no multiplicative part: the -step error is , where is the effect of one unit of error on the forecast steps later, so the variance is . For Holt's method ; for additive Holt-Winters an extra is added when is a multiple of . FPP3 Table 8.7 lists the closed forms. For multiplicative models there is no simple formula; libraries simulate many future paths, as the figure above does for the multiplicative method.
Error correction, step by step. Additive Holt-Winters in error-correction form (ETS(A,A,A)): with ,
Each state is its prediction plus a gain times the one-step error. The gains are , and .
Step through time on the monthly CO₂ series (Mauna Loa, 1980–2001). At each month the one-step forecast meets the data; the error moves the level, the trend (middle panel) and the seasonal state (bottom panel), each by its gain times the error. The equations below the figure show the numbers. Parameters: , , , fitted by least squares. Notice how small the trend gain is: the slope of CO₂ is very stable.
In additive Holt-Winters you set . What happens?
With the update is , so the pattern estimated at the start is repeated unchanged. The season is still in the forecasts. This is the right choice only when the seasonal pattern is truly fixed; otherwise the start values (often estimated from the first two years) dominate.
SES is ARIMA(0,1,1), and the Kalman filter of a local level model
From and : . So
which is an ARIMA(0,1,1) model with MA coefficient (lesson 06, plus-sign convention). Every additive ETS model without a multiplicative part is a special case of an ARIMA model in this way.
The local level model , has two independent noise sources. Its Kalman filter (lesson 07) updates the estimate of as "prediction + gain × innovation", and the gain converges to a constant. In the steady state the filter is SES with equal to that gain, .
3.6 How well does it work? A backtest on CO₂ #
We fit the parameters of each method once on the first 120 months of the CO₂ data (1980–1989), by minimising the SSE. Then we run a rolling origin with an expanding window: at the origins 120, 132, …, 252 (12 folds, one per year), the states are updated with all data up to the origin and we forecast the next 12 months. The table gives the MASE, averaged over the 12 folds and the 12 horizons (lesson 03).
| Method | ETS form | MASE |
|---|---|---|
| seasonal naive | — | 1.00 |
| SES | ETS(A,N,N) | 1.41 |
| Holt | ETS(A,A,N) | 4.93 |
| damped trend | ETS(A,,N) | 1.71 |
| Holt-Winters additive | ETS(A,A,A) | 0.27 |
| Holt-Winters multiplicative | ETS(M,A,M) | 0.27 |
The non-seasonal methods lose to the seasonal naive benchmark, because CO₂ has a strong yearly cycle. Holt's method is the worst: fitted to seasonal data, its slope follows the last month-to-month swing (its fitted and are near 1) and the straight line extrapolates it. Both Holt-Winters methods cut the error of the seasonal naive forecast by about three quarters. Additive and multiplicative are equally good here: the seasonal swings of CO₂ (about ±3 ppm on a level of 340–370 ppm) barely change in size. Damping, often a good default, does not help a series with a steady trend.
(Keeping the parameters fixed and only updating the states is a common, cheap backtest. Refitting the parameters at every origin is more expensive and closer to production; both are honest because the parameters never see data after the origin.)
Answers to section 1. (1) (the newest value has weight 0.5, then 0.25, 0.125, 0.0625). (2) A flat line at the last level. SES has no trend state; on trending data the level also lags behind the data, so the flat forecasts are too low (for an upward trend) and get worse with the horizon. Use Holt's or the damped trend method. (3) Multiplicative (or additive on the log scale).
4. Worked example #
(a) SES by hand. , , data .
| forecast | error | |||
|---|---|---|---|---|
| 1 | 12 | 10 | 2 | 11 |
| 2 | 9 | 11 | −2 | 10 |
| 3 | 13 | 10 | 3 | 11.5 |
| 4 | 11 | 11.5 | −0.5 | 11.25 |
The forecast for every horizon is . Check with the weighted-average form:
The weights are for , and for ; they sum to 1.
Interval. SSE , so and . For : . For : , so . (With only four observations this is only an illustration: is very uncertain.)
(b) Holt by hand. , (so the trend gain is ), , , data .
| forecast | |||||
|---|---|---|---|---|---|
| 1 | 11.5 | 11 | 0.5 | 11.25 | 1.1 |
| 2 | 12 | 12.35 | −0.35 | 12.175 | 1.03 |
| 3 | 14 | 13.205 | 0.795 | 13.6025 | 1.189 |
Check step 1 with the component form: and . The forecasts are the line : for .
(c) Damped forecasts. Suppose a damped trend fit ends with , and .
| damped forecast | Holt line | ||
|---|---|---|---|
| 1 | 0.9 | 14.68 | 14.8 |
| 2 | 1.71 | 15.65 | 16.0 |
| 10 | 20.63 | 25.6 | |
| 24.4 |
(d) Which seasonal state? Quarterly data, , origin . The forecast for horizon uses with :
| 1 | 2 | 3 | 4 | 5 | 6 | |
|---|---|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 1 | 1 | |
| state |
Horizons and use the same state: the last estimate of that quarter.
5. In code #
NumPy reproduces the worked examples and checks the ETS(A,N,N) interval by simulation. The notebook has these cells, a general ETS function and the exercises.
import numpy as np
def ses(y, alpha, l0):
l, levels = l0, []
for v in y:
l = l + alpha * (v - l) # error-correction form
levels.append(l)
return np.array(levels)
y = np.array([12, 9, 13, 11.])
print(ses(y, 0.5, 10.0)) # [11. 10. 11.5 11.25]
w = 0.5 * 0.5 ** np.arange(4) # weights of y4, y3, y2, y1
print(w @ y[::-1] + 0.5**4 * 10.0) # 11.25
# Holt, error-correction form
l, b, alpha, beta_star = 10.0, 1.0, 0.5, 0.4
for v in [11.5, 12, 14]:
e = v - (l + b)
l, b = l + b + alpha * e, b + alpha * beta_star * e
print(round(l, 4), round(b, 4), np.round(l + b * np.arange(1, 4), 4))
# 13.6025 1.189 [14.7915 15.9805 17.1695]
# ETS(A,N,N): simulate 200000 futures and compare the h-step variance with 1 + alpha^2 (h - 1)
rng = np.random.default_rng(0)
alpha, H, N = 0.3, 6, 200_000
eps = rng.normal(size=(N, H))
level = np.zeros(N)
ys = np.empty((N, H))
for k in range(H):
ys[:, k] = level + eps[:, k] # y = previous level + error
level = level + alpha * eps[:, k] # level update
print(np.round(ys.var(axis=0), 3)) # [1.001 1.088 1.183 1.268 1.357 1.447]
print(1 + alpha**2 * np.arange(H)) # [1. 1.09 1.18 1.27 1.36 1.45]
With statsmodels installed, ETSModel(y, error="add", trend="add", seasonal="add", seasonal_periods=12)
fits ETS(A,A,A) by maximum likelihood; with the same parameters and start values it gives the same
fitted values and forecasts as the recursions above (the notebook checks this).
6. Where it shows up #
- Demand planning and inventory. Retail and supply-chain systems forecast thousands of items with ETS models chosen automatically by AICc; the prediction intervals set safety stocks.
- Benchmarks for ML. The M4 "Comb" benchmark (SES, Holt and damped trend, averaged) and automatic ETS are the standard statistical baselines in papers on machine learning for forecasting (lessons 08 and 09).
- Hybrid models. ES-RNN, the winner of M4, used Holt-Winters-style level and seasonal states to normalise each series and an LSTM to forecast the normalised values (Smyl 2020).
- Smoothing in machine learning. The exponential moving average is SES under another name: the running statistics of batch normalisation, the moment estimates of Adam (optimization lesson 06), and EMA weights of trained models all use , that is SES with .
- Monitoring and science. EWMA control charts in quality control and anomaly detection (lesson 11) smooth a signal with SES; sensor and environmental data are often gap-filled and smoothed with Holt-Winters before analysis.
7. Common mistakes #
- Using SES on trending or seasonal data. Its forecast is flat and lags behind a trend. Use Holt, damped trend or Holt-Winters, and compare with the seasonal naive forecast.
- Forgetting that Holt's line never bends. Long-horizon forecasts of Holt's method often overshoot; try the damped trend.
- Confusing and . In component form the trend parameter is ; in ETS
state-space form the trend gain is . Check which one a library reports
(
ETSModelreports ). - Choosing additive seasonality for growing swings. Look at the plot (lesson 01): if the swings grow with the level, use the multiplicative method or a log transform.
- Picking the model with the smallest SSE. More states always fit better in-sample. Compare models with AICc or, better, with a rolling-origin backtest.
- Reading the seasonal index wrongly. The forecast at horizon uses , the last estimate of that season, not for (which lies in the future).
- Treating the recursions as the model. Without the ETS error model there is no likelihood and no valid interval. A "±1.96 σ" band with constant width ignores that the error grows with .
8. Check yourself #
- Show that turns SES into the naive method, and say what does.
Answer
With , , so the forecast is the last value. As the level barely moves: the forecast stays near . If is the mean of the data, SES with very small behaves like the mean method. - A series has the SSE-optimal . What does this tell you about the series, and which
benchmark will SES resemble?
Answer
The best forecast is almost the last value: the series behaves like a random walk (or has a trend or season that SES cannot follow, so it chases the last value). SES then almost equals the naive forecast. If there is a trend or season, try Holt or Holt-Winters. - Damped trend with , , . Give the forecasts for and
, and the limit as .
Answer
: . : . Limit: . - Monthly data, , origin . Which seasonal state does additive Holt-Winters use for
and for ?
Answer
: , state , the same as for . : , state , the same as for . - Why does ETS give prediction intervals while the Holt-Winters recursions alone do not?
Answer
The recursions only produce point forecasts. ETS adds a probability model for the errors ( independent , entering the observation and the state equations). From this model the distribution of follows: for ETS(A,N,N) its variance is . - For ETS(A,N,N) with and , how wide is the 95 % interval at
and at ?
Answer
: . : , so .
Write SES in component form and in error-correction form.
; equivalently with . The forecast is .
What weight does SES give to ?
. The start level gets , and all weights sum to 1.
About how many recent observations carry most of the weight in SES?
About ; the average age of the data in the forecast is steps.
How are the SES parameters usually chosen?
By minimising the sum of squared one-step errors over (and ), with a 1-D search.
Write Holt's forecast and the damped trend forecast.
Holt: . Damped: , which tends to .
Which seasonal state does Holt-Winters use at horizon ?
with : the last updated state of the season of .
What does ETS stand for, and what is ETS(A,N,N)?
Error, Trend, Seasonal. ETS(A,N,N) is , : the model whose point forecasts are SES.
Why does ETS give prediction intervals and the Holt-Winters recursions alone do not?
ETS adds a probability model for the errors, which gives a likelihood and the distribution of future values; the recursions only give point forecasts.
What is the -step forecast variance of ETS(A,N,N)?
.
Additive or multiplicative seasonality: how do you choose?
Additive when the seasonal swings have a fixed size; multiplicative (or additive on ) when the swings grow with the level.
9. Interview angle #
- "Explain exponential smoothing in one minute." — A weighted average of the past with weights ; equivalently a level updated by times the forecast error. Holt adds a trend state, Winters a seasonal state; ETS adds an error model, which gives a likelihood and intervals.
- "How would you choose ?" — Minimise the one-step SSE (maximum likelihood for additive errors) on the training data, then check with a rolling-origin backtest.
- "SES vs ARIMA?" — SES is ARIMA(0,1,1) with ; additive ETS models are special ARIMA models, while multiplicative ETS models have no ARIMA equivalent.
- "What is an exponential moving average in deep learning?" — SES: Adam's moment estimates, batch-norm running statistics and EMA of weights all use .
- "Your Holt forecast explodes after a few months. What do you do?" — Use a damped trend (), check whether the series is seasonal (Holt chases seasonal swings), and compare with seasonal naive in a backtest.
10. Practice #
The notebook for this lesson runs in Colab. It has five exercises, each with a check cell and a folded solution:
- Write
ses(y, alpha, l0)that returns the levels and the one-step forecasts, and check it against the weighted-average formula. - Write
fit_ses(y): a grid over followed byscipy.optimize.minimize_scalaron the SSE. Recover on a simulated local-level series. - Write
holt_winters_additive(y, m, alpha, beta, gamma, H)and check that it reproduces a series built exactly from level, trend and season. - Write the damped trend forecast and show that it converges to .
- Backtest SES, Holt, damped trend and Holt-Winters against seasonal naive on the CO₂ data with
the rolling origin of lesson 03 (and, if
statsmodelsis installed, compare withETSModel).
11. Watch and read #
- Hyndman and Athanasopoulos, Forecasting: Principles and Practice, 3rd ed., chapter 8, free online: §8.1 SES, §8.2 trend, §8.3 seasonality, §8.4 taxonomy, §8.5 ETS models, §8.7 forecasting with ETS.
- Hyndman, Koehler, Ord and Snyder (2008), Forecasting with Exponential Smoothing: The State Space Approach, Springer: the reference for ETS (not free).
- Gardner (2006), Exponential smoothing: The state of the art — Part II, International Journal of Forecasting 22(4).
- Makridakis, Spiliotis and Assimakopoulos (2020), The M4 Competition: 100,000 time series and 61 forecasting methods, International Journal of Forecasting 36(1).
- statsmodels,
ETSModel.
Runs in your browser with nothing to install. The notebook repeats the key demos and has exercises with checks; solutions are inside, folded.
No Google account needed: Python runs inside your browser. The first start downloads about 40 MB; your changes are saved in this browser only.