I have a time-series that I am trying to fit an autoregression model to. I am trying to use the tsCV
method. From the help page I find this:
tsCV
computes the forecast errors obtained by applyingforecastfunction
to subsets of the time seriesy
using a rolling forecast origin.
and from the details section I see
Let
y
contain the time seriesy[1:T]
. Thenforecastfunction
is applied successively to the time seriesy[1:t]
, fort=1,…,T-h
, making predictionsf[t+h]
.
In the examples we have
far2 <- function(x, h){forecast(Arima(x, order=c(2,0,0)), h=h)}
e <- tsCV(lynx, far2, h=1)
meaning that forecast(Arima(x,order=c(2,0,0)),h=h)
would be applied successively to the time series lynx using the rolling forecast origin.
To make this only slightly more complicated, there is also the window
argument which provides a rolling window instead of a rolling origin. My question is: when we apply forecast(Arima(x,order=c(2,0,0)),h=h)
repeatedly are we repeatedly training a new ARIMA model on the new window of the time-series data? Or, is there some how and somewhere a persistent ARIMA model that is trained only once and then referenced for the further calls of the forecast
method?