-
Notifications
You must be signed in to change notification settings - Fork 36
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
Allow xreg and newxreg to take different values for each series in forecast.gts() #6
Comments
a matrix can be passed to htseg2x <- matrix(rnorm(16*17),nrow=16,ncol=17)
htseg2nx <- matrix(rnorm(10*17),nrow=10,ncol=17)
forecast(htseg2 , h=10, fmethod="arima", xreg=htseg2x, newxreg = htseg2nx) |
This is trickier than I thought. There are several possibilities:
The old code handled 1. The new code handles 1 & 2. It should be easy to Any ideas how to make the interface simple while handling all 4 cases? Rob J Hyndman On Thu, Jul 17, 2014 at 5:05 PM, Earo Wang [email protected] wrote:
|
Could we use lists to handle the case where a different matrix or vector should be applied to each level? A list of length equal to the number of levels could contain a vector or matrix to apply to the series in the same column position in the hts/gts. If the xreg/newxreg is a vector or matrix, that vector/matrix would be applied to every level of the series. |
Hi, I am trying to forecast demand across a geographical hierarchy (Cities, States, Countries). I am using external regressors like temperature, humidity etc. which assume different values for different cities. Hence, I need to pass a matrix of external regressors for each bottom node of the hierarchy. Also, how can we aggregate external regressors from one hierarchy level to another (eg. Cities to States)? Sometimes we would need to take their sum, and sometimes average. I apologize if this is the wrong forum to ask this question. If a similar topic exists in another forum, please point me to it. Any help would be appreciated. |
Maybe a new optional argument could be added to indicate what series each regressor corresponds to, and if not given, I'm thinking along the lines of how the That way If, say, using an indicator matrix, 1 and 3 would be the default when NULL, 2 would just be a diagonal matrix, and a denser one could address 4. |
I am using the |
@robjhyndman : thanks for amazing package, Can anyone help me on how to pass "different matrix regressor is applied to each series." ? or is this still not supported with the current version of the package ? |
You currently have to create your own forecasts in a loop and then use |
@robjhyndman , thanks for your response, I will try the following steps, please let me know if I am missing anything.
Thanks, |
Hi @robjhyndman , I have tried I believe I have all the forecast avaialble as per the group object that i created. Could you please let me how can i fix this issue.
Thanks, |
See the example for |
I generated forecasts separately at lowest level granularity. do i need to manually create forecasts for interactions between groups as well ?
with your comment, I understand that I need to create additional forecasts
But when I execute forecast using: Followed by :
1 (top level) 1252 (aggregate by group1) 7 (aggregate by group2) 1252 (what are these series? ) 8764(series at combination of group1 and 2 ) At what level I should generate the other 1252 forecast and in what order should arrange before passing the forecast matrix to Sorry If I missing anything here, thanks a lot for your time. |
Can anyone provide me insight on how to generate individual forecasts and use by |
@robjhyndman, |
Hi There, |
Currently, the following code will work:
But this only allows the same
xreg
andnewxreg
vectors to be applied to all time series. We need to allow a matrix to be passed for each argument.The text was updated successfully, but these errors were encountered: