Lesson 10 of 15

Holt-Winters Method

Holt-Winters (Holt's Linear Trend Method)

Holt's linear trend method extends simple exponential smoothing to capture trends by maintaining two components: a level and a trend.

Update equations

Initialize:

l[0] = xs[0]
b[0] = xs[1] - xs[0]

For t = 1, 2, ...:

l[t] = α · xs[t] + (1 - α) · (l[t-1] + b[t-1])
b[t] = β · (l[t] - l[t-1]) + (1 - β) · b[t-1]
  • α — smoothing parameter for the level
  • β — smoothing parameter for the trend

Forecasting h steps ahead

ŷ[T+h] = l[T] + h · b[T]

Task

Implement:

  • holt_linear(xs, alpha, beta) → returns (levels, trends) as two lists
  • holt_forecast(xs, alpha, beta, h) → h-step ahead forecast
Python runtime loading...
Loading...
Click "Run" to execute your code.