Hello everybody, I have to confess that I am relatively new to R.

My problem is the following one:

I have a data set of 500 values. For each value I wanna make prediction of four steps ahead via autogregression. Because I have to repeat this procedure on three other data sets I wanna make a loop. (Manual calculation would take ages.)
My idea which does not work looks is as follows:

x<-NULL
for (i in 1:500){
x[i]<-predict(ar(y[i],order.max=1,method="yule-walker",intercept=TRUE, n.used=500, n.ahead=4))
}

Doing this I only get an error request that the value of "order.maX" needs to be smaller than "n.used". But this is the case. Isn't it?

Best Regards

______________________________________________
R-help@r-project.org 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.

Reply via email to