Thank you so much! foreL<-8 b0f<-matrix(nrow=9, ncol=foreL) ct<-1 ### use this as the index of b0f for(ar.ord in 1:3){ for(ma.ord in 1:3){ b0f[ct,]<-c(predict(arima(para_qtr[1:(n-8),1],order=c(ar.ord,1,ma.ord)), n.ahead=foreL)$pred) ct<-ct+1 ### increment the counter } } this one works! Best regards!
-- View this message in context: http://r.789695.n4.nabble.com/Loops-tp3814162p3814971.html Sent from the R help mailing list archive at Nabble.com. ______________________________________________ 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.