[R] forecasting issue

totallyunimodular jhemann at vni.com
Mon Mar 30 05:39:51 CEST 2009

For what its worth, I am having the same issue. Specifically, I am using R
2.8.1 on Windows XP, applying auto.arima to the data from the 
http://www.neural-forecasting-competition.com/datasets.htm NN5 forecasting
competition , series NN-101 through NN-111. The relevant code is

     channel <- odbcConnectExcel("NN5_FINAL_DATASET_WITH_TEST_DATA.xls")
     alldata <- sqlFetch(channel, "NN5 COMPLETE Data")
     series <- alldata[17:751,102:112]
     actualWithdrawls <- alldata[752:807,102:112]
     fit <- auto.arima(series[,i], stationary=FALSE, ic="aic", max.p=12,
max.q=3, stepwise=TRUE)
     tmp = predict(fit, n.ahead=56)
     forecast = tmp$pred

As habby reported, every time the optimal model found includes drift, the
call to predict results in 

      Error in predict.Arima(fit, n.ahead = 56) : 
                 'xreg' and 'newxreg' have different numbers of columns

I have found other threads on this same issue with no responses. I am a
fairly new R user, so maybe there is something basic I am doing

I found some interesting, seemingly relevant discussion 
http://www.stat.pitt.edu/stoffer/tsa2/Rissues.htm here  but have yet to
digest it all. 

My basic problem is how to set up auto.arima to be as automated as possible.
I had written a for loop to crunch through all of the series in from the NN5
competition and experiment with different auto.arima settings and compare
out of sample forecast accuracy. But, having run into this issue, its
unclear what the cause is and if/how it can be avoided.

Thanks for any ideas. 

View this message in context: http://www.nabble.com/forecasting-issue-tp21585746p22775817.html
Sent from the R help mailing list archive at Nabble.com.

More information about the R-help mailing list