我有一个月度时间系列,我想生成4个预测(使用ets(),auto.arima(),nnetar()并使用平均值组合3的结果)。我做了以下事情:
library(forecast)
train<-ts(USAccDeaths,end=c(1977,12),frequency=12)
test<-ts(USAccDeaths,start=c(1978,1),end=c(1978,12),frequency=12)
forecast1 <- forecast(ets(train),h=12)$mean
forecast2 <- forecast(auto.arima(train),h=12)$mean
forecast3 <- forecast(nnetar(train),h=12)$mean
forecast4 <- (forecast1+forecast2+forecast3)/3
之后我计算了所有人的MSE:
MSE1<-mean((forecast1-test)^2)
MSE2<-mean((forecast2-test)^2)
MSE3<-mean((forecast3-test)^2)
MSEComb<-mean((forecastComb-test)^2)
我的问题是:如何计算forecast1,forecast2,forecast3和forecastComb(预测组合)的偏差?
谢谢!