1

What is the purpose of and how to use the xreg argument when fitting ARIMA model in R?

My question relates to how the xreg argument is working when fitting an ARIMA model (purpose of xreg described in the post above.)

library(forecast)
fity <- auto.arima(y, xreg=x)

In the code above, is the ARIMA model being fit using past values of $y$ as predictors as well as the past values of $x$? i.e. is it assumed that the past $y$ values would be used as they would be if running an ARIMA modelling without an explanatory variable $x$? Or if I use $\text{xreg} = x$ and want the $y$ series to be used as predictors, would I have to add $y$ to the xreg matrix to force that to occur?

kjetil b halvorsen
  • 63,378
  • 26
  • 142
  • 467
John Curry
  • 131
  • 5
  • Ah, I think I might understand this better after some thought! So the regression is done against the x series. Then the residuals will possibly auto-correlate if there is some sequential structure in the main series that isn't explained by the x series. Those errors are modelled using ARIMA. So its equivalent to doing ARIMA on the main series along with a regression on the explanatory variable. – John Curry Aug 04 '13 at 16:33
  • This might merit a new question but I wonder will this method regress against lagged values of the x series e.g. at lag 1. Or is it only regressing against the x values at the same point in time as the y value. Would I have to add the x series with a lag 1 into the x matrix to force the method to see if the correlation was occuring at a lag? I might want to do this if I think the x variable is a leading variable (with lag 1). – John Curry Aug 04 '13 at 16:37

0 Answers0