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

[EMAIL PROTECTED]

 

 


        [[alternative HTML version deleted]]

______________________________________________
R-help@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.

Reply via email to