Dears Sirs
During my computational work I encountered unexpected behavior when calling
"ar" function, namely
# time series
x<-ts(c(-0.2052083,-0.3764986,-0.3762448,0.3740089,0.2737568,2.8235722,-
1.7783313,0.2728676,-0.3273164),start=c(1978,3),frequency=4,end=c(1980,3))
# ar function
res.ar<-ar(x,aic=TRUE,demean=F)
# call "ar" again and ............
res.ar<-ar(x,aic=TRUE,demean=F)
Error in if (order > 0) coefs[order, 1:order] else numeric(0) :
missing value where TRUE/FALSE needed
In addition: Warning messages:
1: In log(var.pred) : NaNs produced
2: In if (order > 0) coefs[order, 1:order] else numeric(0) :
the condition has length > 1 and only the first element will be used
For me it is mysterious why sometimes it works and others it does not,
perhaps I am doing something wrong and stupid :-(
If anyone had already had this problem could you please tell me how you have
solved it?
Thank you for your time.
Best Regards,
Clara Cordeiro
[[alternative HTML version deleted]]
______________________________________________
[email protected] 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.