Reconciles a hierarchy using the bottom up reconciliation method. The response variable of the hierarchy must be aggregated using sums. The forecasted time points must match for all series in the hierarchy.
reconcile_bu(model)
bottom_up(models)bottom_up() is the original name of reconcile_bu(), and is kept for existing code.
New code should use reconcile_bu(), consistent with the other reconcile_*()
functions.
library(fable)
lung_deaths_agg <- as_tsibble(cbind(mdeaths, fdeaths)) %>%
aggregate_key(key, value = sum(value))
lung_deaths_agg %>%
model(ets = ETS(value)) %>%
dplyr::mutate(ets = reconcile_bu(ets)) %>%
forecast()
#> # A fable: 72 x 5 [1M]
#> # Key: key, .model [3]
#> key .model index
#> <chr*> <chr> <mth>
#> 1 fdeaths ets 1980 Jan
#> 2 fdeaths ets 1980 Feb
#> 3 fdeaths ets 1980 Mar
#> 4 fdeaths ets 1980 Apr
#> 5 fdeaths ets 1980 May
#> 6 fdeaths ets 1980 Jun
#> 7 fdeaths ets 1980 Jul
#> 8 fdeaths ets 1980 Aug
#> 9 fdeaths ets 1980 Sep
#> 10 fdeaths ets 1980 Oct
#> # ℹ 62 more rows
#> # ℹ 2 more variables: value <dist>, .mean <dbl>