0
$\begingroup$

Let's say I fit an ARIMA model on a time series up to date t.

I want to forecast the 10 next values without refitting the model but also using the latest data available for each date.

So forecast for (t+1) uses the model fitted from 1 to t and the time serie from 1 to t

forecast for (t+2) uses the model fitted from 1 to t and the time serie from 1 to t+1

forecast for (t+3) uses the model fitted from 1 to t and the time serie from 1 to t+2

...

This is not the same as simply using "forecast" with an horizon of 5, as I want to take into account all data points prior to the forecasted point. (e.g. a shock on t+2 woudl have an effect on the forecast for t+3, even though we do not refit the entire model)

One way would be to fit the model using data from 1 to t, and then apply this model to all the data and take the fitted values as forecasts.

However this does not work. Even for an horizon of 1, the two methods produces different results.

library(forecast)
data<-c(1,4,3,5,7,8,1,2,6,7,2,3,4,4);
mymodel<-Arima(data[1:10], order=c(1,1,1)) # Fitting the model using data from 1 to 10

forecast(mymodel, h=1)$mean[1] # Forecasting point 11
[1] 5.263669

fitted(Arima(data[1:11],  model = mymodel))[11] # Applying the model estimated from 1 to 10 to data from 1 to 11 and taking fitted values
[1] 5.125379
$\endgroup$

2 Answers 2

2
$\begingroup$

I think this is simply due to a numerically unstable model.

> mymodel
Series: data[1:10] 
ARIMA(1,1,1) 

Coefficients:
         ar1      ma1
      0.3417  -0.9999
s.e.  0.4143   0.7224

Note that the MA coefficient is essentially -1, so the difference operator and MA operator cancel out. Because forecast() uses a different method of computation than fitted(), the numerical instability leads to different results.

If you use a more reasonable model, there is no difference:

mymodel <- Arima(data[1:10], order=c(1,0,1))
forecast(mymodel, h=1)$mean[1] # Forecasting point 11
# 4.98265
mymodel2 <- Arima(data[1:11],  model = mymodel)
fitted(mymodel2)[11]
# 4.98265
$\endgroup$
1
$\begingroup$

I don't remember R syntax well, but I think your last statement will re-estimate ARIMA model to [1:11] data, so your fitted values will essentially be from a different model coefficients than the first call to Arima which was estimated on [1:10] points.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.