I need your help understanding rolling window and expanding window forecasting strategy in r . I am using inflation data from Thailand from between January 2003 and December 2014. My problem is as follows: A) I wish to conduct an out of sample forecast of 4 horizons ahead using An AR(1) model using 50 rolling samples. I wish to set the length of the rolling forecast window to 36 . The last date in the first estimation period should be December 2008. using the results of the forecast i get a RMSE for each of the four forecasting horizon B) how one adjust (A) above to have an expanding window strategy
I have tried using greybox package using the following code
ourCall <- "predict(arima(x=data,order=c(1,0,0)),n.ahead=h)" ourValue <- "pred" returnedValues2 <- ro(x, h=4, origins=50, call=ourCall, value=ourValue, ci=TRUE, co=TRUE) plot(returnedValues2) r=apply(abs(returnedValues2$holdout - returnedValues2$pred),1,mean,na.rm=TRUE) sqrt(r) the results were wrong