dorien
dorien

Reputation: 5387

Apply a specific arima model to another time series in R

I have created an arima model with R based on time series x.

mod1 <- auto.arima(x)

Now I want to see how well this particular model fits a second time series y (maybe get R squared or p-value). I can't seem to find which command this is. I don't think it's "forecast", maybe just arima with different parameters (e.g. passing mod1?).

Thanks for the help!

update--

One thing I tried is the following:

refit <- Arima(y, model=mod1)

This now gives me (on a toy example):

ARIMA(0,0,0) with non-zero mean 

Coefficients:
      intercept
              4
s.e.          0

sigma^2 estimated as 2.4:  log likelihood=-9.28
AIC=20.57   AICc=21.9   BIC=20.18

I'm a bit confused on how to interpret these results. Is there a p-value indicating how well series y fits the model of series x or a similar value?

Upvotes: 1

Views: 897

Answers (1)

dorien
dorien

Reputation: 5387

You can use:

refit <- Arima(y, model=mod1)
accuracy(refit)

This returns a bunch of measures such as MAPE and MASE to analyse how well one model can be used to predict the other data.

Upvotes: 1

Related Questions