Search code examples
rforecasting

Error when using forecastHybrid with hts and external regressors during forecast


I was trying to use forecastHybrid with hierarchical time series and external regressors but I cannot figure out how to do that. I am trying in this way:

library(hts)
library(forecastHybrid)

forecast(htseg1, a.args = list(xreg = data.frame(1:10)), models = "aet", 
xreg = data.frame(11:20), FUN = hybridModel)

But I got the following error:

Error in forecast.Arima(object$auto.arima, h = h, xreg = xreg, level = level) : No regressors provided

Do you know the proper way to do that?


Solution

  • There isn't a clean solution right now but a nice workaround using the combinef() function has been proposed here:

    https://github.com/ellisp/forecastHybrid/issues/74