Search code examples
rforecast

How to specify the forecasting level in hierarchical forecasting?


I am using hts package in R to do Hierarchical forecasting. In the forecast() function how do I specify the level in which forecast has to be done?

Will it always forecast on the very top level and disaggregate it by the selected disaggregation strategy?

d = forecast(c, h = 12, method = "tdgsf", fmethod = "ets", keep.fitted = TRUE)

In the above mentioned code I have c = hierarchical time series with 2 levels, h = forecast horizon, method = dissaggregation strategy, fmethod = forecasting method.

On which level the forecast will happen? Can I specify the level in which forecast should happen?


Solution

  • In the forecast call, you are assigning 'tdgsf' to method. This stands for “top-down Gross-Sohl method F”. You are assigning the initial forecast to be created at the top level then using historical proportions of the lower levels to create the forecasts of those lower levels. If you want to start with the bottom-level and work up, assign 'bu' to method.

    d = forecast(c, h = 12, method = "bu", fmethod = "ets", keep.fitted = TRUE)
    

    Since you only have two levels, you cannot use method = "mo", but if you had 3 or more, you would then set the level argument equal to the hierarchical level you wish to begin from.

    I recommend this ebook written by Rob Hyndman, the creator of the forecast and hts packages. Chapter 10 is all about heirarchical and grouped time series forecasts.