Exponential Smoothing in Python — Core Concepts

Why exponential smoothing still matters

Despite the rise of machine learning, exponential smoothing methods consistently perform well in forecasting competitions. In the M4 competition (100,000 time series), the winning method combined exponential smoothing with neural networks. These methods are fast, interpretable, and surprisingly hard to beat on many real-world datasets.

The three levels of exponential smoothing

Simple Exponential Smoothing (SES)

For data with no trend and no seasonality. The forecast is a weighted average where recent observations get exponentially higher weights:

ŷₜ₊₁ = α · yₜ + (1 − α) · ŷₜ

The smoothing parameter α (between 0 and 1) controls how much weight goes to the latest observation:

  • α close to 1 → almost all weight on the most recent value (reactive)
  • α close to 0 → weights spread more evenly across history (smooth)
from statsmodels.tsa.holtwinters import SimpleExpSmoothing

model = SimpleExpSmoothing(series).fit(smoothing_level=0.3, optimized=False)
forecast = model.forecast(steps=10)

Setting optimized=True (the default) lets statsmodels find the best α automatically by minimizing the sum of squared errors.

Holt’s Linear Method (Double Exponential Smoothing)

Adds a trend component. Two equations work together:

  • Level: ℓₜ = α · yₜ + (1 − α)(ℓₜ₋₁ + bₜ₋₁)
  • Trend: bₜ = β · (ℓₜ − ℓₜ₋₁) + (1 − β) · bₜ₋₁

Where β controls how quickly the trend estimate adapts.

from statsmodels.tsa.holtwinters import Holt

model = Holt(series, damped_trend=True).fit()
forecast = model.forecast(steps=30)

The damped_trend option (highly recommended) flattens the trend over time so forecasts do not shoot off to infinity. In practice, most trends slow down eventually.

Holt-Winters (Triple Exponential Smoothing)

Adds seasonality on top of trend. This is the full-featured version:

from statsmodels.tsa.holtwinters import ExponentialSmoothing

model = ExponentialSmoothing(
    series,
    trend="add",           # additive trend
    seasonal="mul",        # multiplicative seasonality
    seasonal_periods=12,   # monthly data with yearly cycle
    damped_trend=True,
).fit()

forecast = model.forecast(steps=24)

Additive vs. multiplicative

  • Additive seasonality: seasonal swings stay the same size regardless of the level. January always adds 500 units.
  • Multiplicative seasonality: seasonal swings scale with the level. January is always 20% above average.

Most business data with growth trends needs multiplicative seasonality because the absolute seasonal swings grow as the business grows.

How Python chooses parameters

When you call .fit() without specifying parameters, statsmodels optimizes α, β, and γ by minimizing the sum of squared one-step-ahead forecast errors. This is equivalent to maximum likelihood estimation under the assumption of normally distributed errors.

model = ExponentialSmoothing(
    series,
    trend="add",
    seasonal="add",
    seasonal_periods=7,
).fit(optimized=True, remove_bias=True)

print(f"Alpha: {model.params['smoothing_level']:.4f}")
print(f"Beta:  {model.params['smoothing_trend']:.4f}")
print(f"Gamma: {model.params['smoothing_seasonal']:.4f}")

Comparing methods at a glance

Data patternBest methodParameters
Flat, no trendSESα
Trend, no seasonalityHolt (damped)α, β
Trend + seasonalityHolt-Wintersα, β, γ
Seasonality scales with levelHolt-Winters multiplicativeα, β, γ

Common misconception

Many people think exponential smoothing is “too simple” for modern forecasting. In reality, the ETS (Error, Trend, Seasonal) framework — the statistical foundation behind these methods — covers 30 different model variants and provides proper prediction intervals. It is a complete forecasting framework, not just a smoothing trick.

The one thing to remember: Exponential smoothing is a family of methods that range from dead-simple (one parameter) to fully-featured (trend + seasonality), and they remain competitive with far more complex approaches because they adapt quickly to recent changes in the data.

pythontime-seriesexponential-smoothingforecasting

See Also