Dear forecast scientists,

I'm using the R 'Forecast' package to generate batch forecasts. I have a question regarding some of the great auto-fit techniques offered by this package (E.g., auto.arima,ar,tbats,ets).

The proposed workflow is as follows:

Step 1: Define hold-out period (test data, basically) and then push the training set to R for forecasting. Run different auto-fit techniques in R, and figure out which method gives the least error (e.g., based on RMSE)

Step 2: In the second iteration, I am wondering if I can pass the data again (this time with ALL time series observations) while using the best fit model (established in Step 1) to generate the forward forecast.

For carrying out Step 2, I am not sure of how to isolate the parameters used by the auto-fit techniques. As someone with a cursory exposure to forecast concepts (primarily self taught so far), it would be great if there is an easy means to obtain this information and pass it back. (E.g., AR-> AR, Auto.ARIMA-> ARIMA)

I am afraid if I run Step 2 and invoke an auto-fit command again, it can possibly worsen the over fitting problem by choosing an all-together different model, which will be in conflict with the purpose of Step 1.

Please consider the following sample code for an Auto-Regression Run for sample SKU:

    ###Time Series          

    ###Training Data

         wseriests <- ts(wseries[1:32],frequency=12)

    ###Test Data (Setting 4 M hold-out period)


    ###Auto-Regression Run

         forecastobj <- ar(wseriests, aic = TRUE)

    ###4-Period Forward Forecast and Out-of-Sample-Accuracy Calculation

         predobj <- forecast.ar(forecastobj , h=4)


    ###5-Which model has Auto-Regression chosen? Which parameters and 
    corresponding values do I pass back to the ar model for my second 

         [1] 2  

         [1] 0.3965009 0.3598146

         [1] ar(x = wseriests, aic = TRUE)

Best regards,



Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.