Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

`xreg` issue when having user-defined forecast function #28

Closed
earowang opened this issue Feb 28, 2017 · 2 comments
Closed

`xreg` issue when having user-defined forecast function #28

earowang opened this issue Feb 28, 2017 · 2 comments
Labels
bug

Comments

@earowang
Copy link
Owner

@earowang earowang commented Feb 28, 2017

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
@earowang earowang added the bug label Feb 28, 2017
@earowang
Copy link
Owner Author

@earowang earowang commented Feb 28, 2017

If users define their own forecast function where there's an xreg argument, then newxreg needs to be supplied and should appear in line 117 of forecast.gts.R.

earowang added a commit that referenced this issue Jun 20, 2017
@earowang
Copy link
Owner Author

@earowang earowang commented Jun 20, 2017

library(hts)
library(forecastHybrid )

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

This should work now.

@earowang earowang closed this Jun 20, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant
You can’t perform that action at this time.