I have been looking for a function that can make recursive window out-of-sample forecasts, but seems there is none. So I'm thinking about about making a function that can be used for recursive window forecasting in an ARIMA model. However I know little about programming, so I'm seeking for help.
What I want to do is use the function forecast.Arima
(forecast package) to predict future values in a expanding window. Suppose 20 years is the initial window, and I expand the window by 1 year on each iteration until it is of size 30 years. More specifically, use 20 years data to predict one value, use 21 years data to predict the next value, etc.