[R] arima, xreg, and the armax model

David Stoffer dsstoffer at gmail.com
Mon May 4 03:51:06 CEST 2009

Hi Marc- I have been [and am] extremely busy and haven't had much time to be
a playeR (lately I've become more of a moveR and shakeR ... some say more of
a boozeR and a loseR ... it's all prespective :).  I've updated the web page
with a little more info, but when I find the time I'll put up some ARMAX
examples on the Ch 6 page (state space models).  I think Paul Gilbert's DSE
package will do the job if you need it now.

The arima() help file says xreg does regression with autocorrelated errors,
and that is indeed what it does. The key line in arima.R is:  if(ncxreg > 0)
x <- x - xreg %*% par[narma + (1L:ncxreg)], so you see it replaces "x(t)"
with "x(t)-beta*xreg(t)" so to speak.  

... and, as usual, I stand on the GNU General Public License clause that
proclaims anything I say or do comes without even the implied warranty of
anything wrong with being fit for a particular purpose).

Marc Anonym-2 wrote:
> Hello all,
> I'm having fun again with the arima function. This time I read in:
> http://www.stat.pitt.edu/stoffer/tsa2/R_time_series_quick_fix.htm
> <<It has recently been suggested (by a reliable source) that using xreg in
> arima() does NOT fit an ARMAX model [insert slap head icon here]. This
> will
> be investigated as soon as time permits.>>
> (by R.H. Shumway & D.S. Stoffer)
> This is quite surprising... Does anybody know anything about it?
> Marc Anonym (Acompany)
> 	[[alternative HTML version deleted]]
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

The power of accurate observation is commonly called cynicism 
by those who have not got it.  George Bernard Shaw
View this message in context: http://www.nabble.com/arima%2C-xreg%2C-and-the-armax-model-tp22724290p23361962.html
Sent from the R help mailing list archive at Nabble.com.

More information about the R-help mailing list