Re: [R] question about xreg of arima

From: Richard Saba <sabaric_at_charter.net>
Date: Sat, 12 Jan 2008 10:28:39 -0600


Tom

A constant term is not included in the model if any differencing is specified. The xreg= parameter is used to add other explanatory variables to the model. In your case xreg=1:length(x) adds a vector of 1's to the model. Robert Shumway and David Stoffer's website for their "Time Series Analysis an its Applications with R Examples" text has several very helpful documents posted on the site (http://www.stat.pitt.edu/stoffer/tsa2/index.html) specific to time series analysis. The R ISSUES document address your question.  

Richard  

>Hi,

>I am trying to understand exactly what xreg does in arima. The
documentation for xreg says:"xreg Optionally, a vector or matrix of external regressors, which must have >the same number of rows as x." What does this mean with regard to the action of xreg in arima?    

>Apparently somehow xreg made the following two arima fit equivalent in R:

>arima(x, order=c(1,1,1), xreg=1:length(x))

>is the same as

> arima(diff(x), order=c(1,0,1))

>While I understand the latter fit (I think), I am puzzled with regard to
the former. Does anyone know what the former is doing to arima, and why it works as it does?

>Thanks!

-- 


>Tom
Richard Saba Department of Economics Auburn University Auburn, AL 36849 USA sabaric_at_auburn.edu [[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.
Received on Sat 12 Jan 2008 - 16:35:11 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Sun 13 Jan 2008 - 15:30:05 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive