0
$\begingroup$

I had a question about whether the forecast package in R allows you to use new data for forecasting when modeling with STL + Arima? I found a question from 7 years ago here, but was wondering if anything has changed since then? I've looked at the documentation and I'm a bit confused on xreg vs newxreg.

$\endgroup$
  • $\begingroup$ Why not read the package documentation? $\endgroup$ – jbowman Jan 25 at 17:55
  • $\begingroup$ I have RTM, and I'm not too clear on the difference between xreg and newxreg. $\endgroup$ – user235349 Jan 25 at 18:18
  • $\begingroup$ This link robjhyndman.com/hyndsight/hts-with-regressors might help; basically, xreg are the values of the regressors used in fitting the model, i.e., the historical values of the regressors, and newxreg are the values of those same regressors used in generating forecasts, i.e., the future values of the regressors. $\endgroup$ – jbowman Jan 25 at 19:39
  • $\begingroup$ (Using panda) It would appear that using xreg=NewDataDF and newxreg=NewDataDF, h=len(NewDataDF.index) in the forecasting arguments leads to the same forecast. $\endgroup$ – user235349 Jan 25 at 20:50
  • $\begingroup$ I think newxreg defaults to xreg if there's no explicit argument passed. $\endgroup$ – jbowman Jan 25 at 23:09

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.