Q: Why do I get a different shape of output when producing bootstrap-simulated forecasts from bottom-up vs top-down hierarchical reconciliation procedures in the R tidyvets/fable framework?
Borrowing from Forecasting Principles and Practice, Ch. 11.2
library (fpp3)
# making sure to set seed, so that the bottom-up reconciled forecasts `bu` use
# the same bootstrapped sample as the baseline forecasts `ets`.
B -> 2
tourism_states %>%
model(ets = ETS(Trips)) %>%
reconcile(bu = bottom_up(ets),
tpd = top_down(ets)) %>%
forecast(bootstrap=TRUE,times=B,seed=1) ->
fcs
fcs %>% # to display
filter(State=='ACT' | is_aggregated(State)) %>%
group_by(State,.model) %>%
slice(1:2)
# # A fable: 12 x 5 [1Q]
# # Key: State, .model [6]
# # Groups: State, .model [6]
# State .model Quarter Trips .mean
# * <chr*> <chr> <qtr> <dist> <dbl>
# 1 ACT bu 2018 Q1 sample[2] 600.
# 2 ACT bu 2018 Q2 sample[2] 730.
# 3 ACT ets 2018 Q1 sample[2] 600.
# 4 ACT ets 2018 Q2 sample[2] 730.
# 5 ACT tpd 2018 Q1 598.2936 598.
# 6 ACT tpd 2018 Q2 753.1552 753.
# 7 <aggregated> bu 2018 Q1 sample[2] 28832.
# 8 <aggregated> bu 2018 Q2 sample[2] 27310.
# 9 <aggregated> ets 2018 Q1 sample[2] 28753.
# 10 <aggregated> ets 2018 Q2 sample[2] 28181.
# 11 <aggregated> tpd 2018 Q1 28753.29 28753.
# 12 <aggregated> tpd 2018 Q2 28181.15 28181.
As expected, bottom-up bu
and baseline ets
methods produce a length=2 bootstrapped forecast in Trips
. But, to my surprise, top-down tpd
only produces a single estimate, the mean. This is even the case at the aggregated level, where the tpd
bootstrapped forecast would simply be exactly the same as the baseline forecasts ets
.
What’s going on here? Why doesn’t top-down work the way I’d expect? I’d like to produce bootstrapped forecast simulation paths for the top-down methodology. How can I do that here? If it’s not done easily, is there a hack I can use? E.g., would I have to loop over the total number of bootstrap simulations B
and, instead, forecast with forecast(bootstrap=TRUE,times=1,seed=1)
within each iteration?
Note, this issue I’m having with top-down also goes for middle-out.