Questions:
- Are rolling forecast examples (like the ones below) only useful for evaluating a model's accuracy, or can a rolling forecast be used to train a model?
- Are models trained using a rolling forecast generally more accurate?
- Can anyone point out an example of a model being trained using a rolling window/rolling forecast technique and forecasted horizons in to the future? By that I mean forecasted horizons beyond the training/testing data used in the rolling forecast.
Examples:
http://robjhyndman.com/hyndsight/tscvexample/
http://robjhyndman.com/hyndsight/rolling-forecasts/
Code:
library("fpp")
h <- 5
train <- window(hsales,end=1989.99)
test <- window(hsales,start=1990)
n <- length(test) - h + 1
fit <- auto.arima(train)
fc <- ts(numeric(n), start=1990+(h-1)/12, freq=12)
for(i in 1:n)
{
x <- window(hsales, end=1989.99 + (i-1)/12)
refit <- Arima(x, model=fit)
fc[i] <- forecast(refit, h=h)$mean[h]
}