4
$\begingroup$

I am really new with R and time series. But, I have understood most concept. Part where I am (very) confused is the xreg= argument in arima() from tseries package and forecast package. As I have read most of the related threads on this site, I understand that xreg is used for exogenous data. See for example, How to fit an ARIMAX-model with R?.

Thus, I conclude that I can fit SARIMAX or ARMAX method using arima(). However, I am currently reading Shumwhay's book and his web tutorial.

If you check the website (close to the bottom of the page), you can found that he said

xreg in arima() does not fix ARMAX model.

It is also explained in the R issues on his website. In addition, he proposed fitting ARMAX model in state space model. So, the answers found on this site and the explanation in the website are completely different.

Can anyone explain me why there is such discrepancy? Which one is correct?

If Shumwhay is correct, is there any function/package that can fit ARMAX or SARIMAX model in R?

Sorry if it turns out I only missed some points, but I hope you can point me to the right direction.

$\endgroup$

1 Answer 1

12
$\begingroup$

An ARMAX model simply adds in the covariate on the right hand side of the usual ARMA equation: $$ y_t = \beta x_t + \phi_1 y_{t-1} + \cdots + \phi_p y_{t-p} - \theta_1 z_{t-1} - \dots - \theta_q z_{t-q} + z_t $$ where $z_t$ is white noise, $x_t$ is a covariate at time $t$ and $\beta$ is its coefficient. There is no R function that fits exactly this model, although the transfer function model implemented by the TSA package is similar (the above model is a transfer function model but with a parameter constraint).

The model used by arima() and auto.arima() with an xreg argument is a linear regression with ARMA errors: \begin{align*} y_t &= \beta x_t + n_t\\ n_t &= \phi_1 n_{t-1} + \cdots + \phi_p n_{t-p} - \theta_1 z_{t-1} - \dots - \theta_q z_{t-q} + z_t \end{align*}

For more details, see my blog post on the various models and how they are related.

$\endgroup$
1
  • 1
    $\begingroup$ @ Rob Hyndman.. I have realized it yesterday, but your explanation made it much clearer..thank you very much..btw, I love your work on the package..thank you for all the lectures and explanation on it..I am reading it along with shumwhay's book..I didn't expect my question would be answered by you from all people,, $\endgroup$ Commented Apr 4, 2012 at 10:48

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.