Talarico Massimiliano (Xelion)
2005-Jul-04 07:15 UTC
[R] RESIDUALS IN THE AR TIME SERIES FUNCTION
Dear all, It's possible to obtain the residuals with AR time series function. Thanks in advance, Massimiliano Talarico Pianificazione Commerciale - Area Crm Unicredit Xelion Banca S.p.A. Via Pirelli 32 - 20124 Milano Tel.: 02 67360 525 Fax: 02 67738 525 www.xelion.it [[alternative HTML version deleted]]
On 7/4/05, Talarico Massimiliano (Xelion) <Massimiliano.Talarico at xelion.unicredit.it> wrote:> Dear all, > > It's possible to obtain the residuals with AR time series function.There is no residuals method for the "ar" class but you could try this using the lh dataset as an example. Note that the zoo package is required in order to use zoo's lag function, which has been enhanced to take a vector of lags, and dyn of the dyn package is used to add dynamic regression capabilities to lm. Also, this example uses features in the most recent versions of the dyn and zoo packages so be sure you have the latest ones from CRAN. ar(lh) library(dyn) # this also brings in zoo lh.zoo <- as.zoo(lh) lh.lm <- dyn$lm(lh.zoo ~ lag(lh.zoo, -seq(3))) lh.lm # seems close to the coefficients calculated by ar resid(lh.lm)
On Mon, 4 Jul 2005, Talarico Massimiliano (Xelion) wrote:> Dear all, > > It's possible to obtain the residuals with AR time series function.Yes, that's true if you refer to the function ar(). Or was it a question? If so, look at the `value' section of help(ar) which gives you the answer. Z> > > Thanks in advance, > > Massimiliano Talarico > > Pianificazione Commerciale - Area Crm > > Unicredit Xelion Banca S.p.A. > > Via Pirelli 32 - 20124 Milano > > Tel.: 02 67360 525 > > Fax: 02 67738 525 > > www.xelion.it > > > > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html >