[R-SIG-Finance] ARIMA, xreg and intercepts

Brian G. Peterson brian at braverock.com
Thu Nov 12 15:35:26 CET 2009


Rather than reposting, you might get more of a response if you followed 
the posting guide:

http://www.r-project.org/posting-guide.html

and provided a reproducible example.

It seems that from your pseudocode, you could test your own hypothesis, 
but you didn't provide data, so I can't check.  If your hypothesized 
behavior did not materialize, as seems likely, then providing the steps 
that you tried, what you expected/wanted to happen, and what happened 
instead would assist someone else who felt like helping you out.

Also, it is considered impolite to attach claims of confidentiality to a 
public mailing list.

Regards,

  - Brian

Brecknock, Peter wrote:
> Re-posting from Monday .......
>
> Hi All
>
> David Stoffer describes some challenges with R's output when fitting
> ARIMA models for different orders (see Issue 2 at
> http://www.stat.pitt.edu/stoffer/tsa2/Rissues.htm). R doesn't fit an
> intercept in the model if there is any differencing. David describes a
> workaround using the xreg parameter to force R to calculate an
> intercept.
>
> Assume I have a variable y and 3 explanatory variables a, b and c. 
>
> No intercept would be produced for the model .... fit = arima(y,
> order=c(1,1,0), xreg=c(a,b,c)) 
>
> 1. If I wish to force an intercept to be output is the following
> correct?
>
> intercept = 1:length(y) 
> fit1 = arima(y, order=c(1,1,0), xreg=c(intercept, a, b, c)) 
>
> 2. If 1 is correct, is the following code equivalent?
>
> data = ts.intersect(diff(y),intercept, a,b,c)
> fit2 = arima(data[,1], order=c(1,0,0), xreg=[,c(2:5)]) 
>
> 3. If I fit 2 and find the intercept is not significant would it then be
> correct to use the following?
>
> fit = arima(y, order=c(1,1,0), xreg=c(a,b,c)) 
>
>
> Thanks for your help
>
> Kind regards
>
> Pete
>   


-- 
Brian G. Peterson
http://braverock.com/brian/
Ph: 773-459-4973
IM: bgpbraverock



More information about the R-SIG-Finance mailing list