> but I was wondering if there is a simpler way of doing this in R without > using a for loop. > Thanks, sure, check out ARIMA http://stat.ethz.ch/R-manual/R-patched/library/stats/html/arima.html thomas