28.5 Holt-Winters

可加 Holt-Winters (Winters 1960; Holt 2004) 预测函数,周期长度为 p

\[ \hat{Y}[t+h] = a[t] + h * b[t] + s[t - p + 1 + (h - 1) \mod p \]

其中 \(a[t], b[t], s[t]\) 由以下决定

\[\begin{align} a[t] &= \alpha (Y[t] - s[t-p]) + (1-\alpha) (a[t-1] + b[t-1]) \\ b[t] &= \beta (a[t] - a[t-1]) + (1-\beta) b[t-1] \\ s[t] &= \gamma (Y[t] - a[t]) + (1-\gamma) s[t-p] \end{align}\]

可乘 Holt-Winters

\[ \hat{Y}[t+h] = (a[t] + h * b[t]) * s[t - p + 1 + (h - 1) \mod p] \]

其中 \(a[t], b[t], s[t]\) 由如下决定

\[\begin{align} a[t] &= \alpha (Y[t] / s[t-p]) + (1-\alpha) (a[t-1] + b[t-1]) \\ b[t] &= \beta (a[t] - a[t-1]) + (1-\beta) b[t-1] \\ s[t] &= \gamma (Y[t] / a[t]) + (1-\gamma) s[t-p] \end{align}\]

HoltWinters() 用 Shiny App / 动画的形式展示 \(\alpha, \beta, \gamma\) 三个参数对模型预测的影响,参数的确定通过最小化预测均方误差

## Seasonal Holt-Winters
(m <- HoltWinters(co2))
plot(m)
plot(fitted(m))

p <- predict(m, 50, prediction.interval = TRUE)
plot(m, p)

(m <- HoltWinters(AirPassengers, seasonal = "mult"))
plot(m)

## 指数平滑 Exponential Smoothing
m2 <- HoltWinters(x, gamma = FALSE, beta = FALSE)
lines(fitted(m2)[,1], col = 3)

参考文献

Holt, Charles C. 2004. “Forecasting Seasonals and Trends by Exponentially Weighted Moving Averages.” International Journal of Forecasting 20 (1): 5–10. https://doi.org/10.1016/j.ijforecast.2003.09.015.
Winters, Peter R. 1960. “Forecasting Sales by Exponentially Weighted Moving Averages.” Management Science 6 (3): 324–42. https://doi.org/10.1287/mnsc.6.3.324.