Skip to content
Prev 130448 / 398500 Next

help pleaseeeeeeeee

CCordeiro wrote:
Dear Clara,

  this did actually get investigated, but was continued in a thread
on the R development list:

http://www.nabble.com/Bug-in-package-stats-function-ar%28%29-%28PR-10459%29-tf4864536.html

  The problem is indeed with the "order.max" calculation, which should
not allow order.max to equal the length of the data series (but does
for very short time series).  There are no random numbers involved
in this calculation.

Something like

res.ar<-ar(x,aic=TRUE,demean=F,order.max=length(x)-1) 

  should prevent this particular problem from happening ...

  Ben Bolker

 PS: it was very good of you to give a reproducible example,
and very helpful of you to point out this bug.  In the future,
the other helpful thing you could do is give your message
an informative subject line (e.g. "problem with ar()" rather
than "help pleaseeeeeee") ...