## 12.4 预测组合

train <- window(auscafe, end=c(2012,9))
h <- length(auscafe) - length(train)
ETS <- forecast(ets(train), h=h)
ARIMA <- forecast(auto.arima(train, lambda=0, biasadj=TRUE), h=h)
STL <- stlf(train, lambda=0, h=h, biasadj=TRUE)
NNAR <- forecast(nnetar(train), h=h)
Combination <- (ETS[["mean"]] + ARIMA[["mean"]] +
STL[["mean"]] + NNAR[["mean"]] + TBATS[["mean"]])/5
autoplot(auscafe) +
autolayer(ETS, series="ETS", PI=FALSE) +
autolayer(ARIMA, series="ARIMA", PI=FALSE) +
autolayer(STL, series="STL", PI=FALSE) +
autolayer(NNAR, series="NNAR", PI=FALSE) +
autolayer(TBATS, series="TBATS", PI=FALSE) +
autolayer(Combination, series="Combination") +
xlab("年") + ylab("十亿美元") +
ggtitle("澳大利亚外出就餐月支出") +
theme(text = element_text(family = "STHeiti"))
c(ETS=accuracy(ETS, auscafe)["Test set","RMSE"],
ARIMA=accuracy(ARIMA, auscafe)["Test set","RMSE"],
STL-ETS=accuracy(STL, auscafe)["Test set","RMSE"],
NNAR=accuracy(NNAR, auscafe)["Test set","RMSE"],
TBATS=accuracy(TBATS, auscafe)["Test set","RMSE"],
Combination=accuracy(Combination, auscafe)["Test set","RMSE"])
#>         ETS       ARIMA     STL-ETS        NNAR
#>     0.13700     0.15920     0.19310     0.31769
#>       TBATS Combination
#>     0.09406     0.07161

TBATS 方法在这个时间序列数据中表现的非常好，但是使用预测组合方法会得到更好的结果。对于其他数据， TBATS 可能会表现的非常糟糕，而预测组合方法的效果几乎总是接近或优于最佳方法。

### 参考文献

Bates, J. M., & Granger, C. W. J. (1969). The combination of forecasts. Operational Research Quarterly, 20(4), 451–468. [DOI]
Clemen, R. (1989). Combining forecasts: A review and annotated bibliography. International Journal of Forecasting, 5(4), 559–583. [DOI]