[R] combining arima and ar function

2011-12-01 Thread Samir Benzerfa
Hi everyone I've got a problem regarding the arima() and the ar() function for autoregressive series. I would simply like to combine them. To better understand my question, I first show you how I'm using these two functions individually (see file in the attachement). 1)

Re: [R] combining arima and ar function

2011-12-01 Thread R. Michael Weylandt
I think your attachment got scrubbed so I can't verify this, but i think the difficulty is that the inner apply returns a whole set of orders, instead of just one and that throws arima off: would this work? getOrder - function(x) ar(na.omit(x), method = mle)$order all.equal(apply(TSX, 2,