Re: [R] ARMA

From: Pete Brecknock <Peter.Brecknock_at_bp.com>
Date: Sun, 08 May 2011 15:27:44 -0700 (PDT)

boki2b wrote:
>
> Hello,Could somebody tell me what is the difference between  theese 3
> calls of functionsarma(x,order=c(1,0)), arima(x,order=c(1,0,0))
> ar(x,order=1)?I expected same residuals of theese three models,but
> unexpectably for the first two R requiredinitial value of something
> (what?)...Thanks in advance! 
> [[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.
>

Firstly, all of the functions you mention can be explored in more detail by typing ?xxx, where xxx is ar, arima or arma. Note, you will need the tseries package to run the arma function. (require(tseries))

Secondly, there is some debate around interpretation of some of the output from these functions. Check out one viewpoint at http://www.stat.pitt.edu/stoffer/tsa2/Rissues.htm (ISSUE 1: When is the intercept the mean?)

Finally, I have tried below to put the functions on a similar footing to allow you to compare their output.

# create data
set.seed(12345)
d = rnorm(30)

library(tseries) # need for arma function

# 1. arma
# fits using conditional least squares, "intercept" is the "intercept" arma(d,order=c(1,0))
> ar1 intercept
> -0.10566 0.07046

# 2. arima
# "intercept" is the "mean", intercept derived as mean*(1-AR1) arima(d,order=c(1,0,0),method="CSS")
> ar1 intercept
> -0.1057 0.0638

So, intercept = 0.0638 * (1 + 0.1057) = 0.0705 ... same as arma above

# 3. ar
"intercept" is the "intercept"
ar(d,aic=FALSE, order.max=1,method="ols",intercept=TRUE, demean=FALSE)
> 1
> -0.1057
> Intercept: -0.07054 (0.1731)

There is a nice document on CRAN that you may find useful.  

http://cran.r-project.org/doc/contrib/Ricci-refcard-ts.pdf

HTH Pete

--
View this message in context: http://r.789695.n4.nabble.com/ARMA-tp3507846p3507963.html
Sent from the R help mailing list archive at Nabble.com.

______________________________________________
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 Sun 08 May 2011 - 22:32:44 GMT

This quarter's messages: by month, or sorted: [ by date ] [ by thread ] [ by subject ] [ by author ]

All messages

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 08 May 2011 - 23:20:06 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