Forecast with STL and Regressors Using R Package Forecast – How to Execute

forecastingrregression

I would like to use the stlf forecast function from the R package forecast (http://cran.r-project.org/web/packages/forecast/index.html) and include regressors in the model.

Question 1: This can only be done using "" method="arima" "" – right?

Question 2: For the model calibration the parameter "xreg" should work but how can I enter the new data for th forecast? "newxreg" did not work for me.

Thank you

Best Answer

The forecast.stl() function does not allow for regressors. If you include an xreg argument with method="arima", it will be used in the fitted model, but not in the forecasts. You could modify the forecast.stl() function to handle this.