简体   繁体   中英

simple autoregression AR(1) residuals, in R

I'm trying to use simple AR(1) process. I have some 8 values. How can i get the residuals of each step? for example:

residuals(ar(AirPassengers,aid = FALSE,order.max = 1,method = "ols"))

returns NULL .

See, eg, ar(AirPassengers, aid = FALSE, order.max = 1, method = "ols")$resid . That is, instead of applying functions resid or residuals , you should check the element resid that ar returns.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM