Reputation: 1
I am forecasting hierarchical time series using a FB Prophet model via fable/fable.prophet.
The hierarchy only has two levels (individual data and aggregate). Prophet returns confidence intervals for the individual time series, but not for the reconciled forecasts. Instead, it simply returns the single value estimated.
Data %>%
model(prophet = prophet(Variable ~ season(period = 12, type = "additive"))) %>%
reconcile(min_trace(prophet),top_down(prophet), bottom_up(prophet)) %>%
forecast(h = 12)
Is this due to the modeling framework in fable or could it be something to do with my data? FWIW, the same issue is occurring with neural network heirarchies in fable.
Upvotes: 0
Views: 345
Reputation: 2459
Please provide a minimally reproducible example. I don't have access to Data
, so I cannot check your code/result.
I suspect this is due to the nature of the forecasts from a prophet model. Until recently, only normally distributed forecasts could be reconciled with uncertainty. Unsupported distributions will revert back to point forecast reconciliation, giving you the single values you mention.
The latest development version of fabletools supports reconciliation of sample paths, which is what you need for prophet models.
Try updating fabletools with remotes::install_github("fabletools")
.
library(fable.prophet)
#> Loading required package: Rcpp
#> Loading required package: fabletools
Data <- as_tsibble(cbind(mdeaths, fdeaths)) %>%
aggregate_key(key, value = sum(value))
Data %>%
model(prophet = prophet(value ~ season(period = 12, type = "additive"))) %>%
reconcile(min_trace(prophet),top_down(prophet), bottom_up(prophet)) %>%
forecast(h = 12)
#> # A fable: 144 x 5 [1M]
#> # Key: key, .model [12]
#> key .model index value .mean
#> <chr*> <chr> <mth> <dist> <dbl>
#> 1 fdeaths prophet 1980 Jan sample[5000] 725.
#> 2 fdeaths prophet 1980 Feb sample[5000] 935.
#> 3 fdeaths prophet 1980 Mar sample[5000] 826.
#> 4 fdeaths prophet 1980 Apr sample[5000] 570.
#> 5 fdeaths prophet 1980 May sample[5000] 482.
#> 6 fdeaths prophet 1980 Jun sample[5000] 400.
#> 7 fdeaths prophet 1980 Jul sample[5000] 377.
#> 8 fdeaths prophet 1980 Aug sample[5000] 303.
#> 9 fdeaths prophet 1980 Sep sample[5000] 341.
#> 10 fdeaths prophet 1980 Oct sample[5000] 410.
#> # … with 134 more rows
Created on 2022-09-17 by the reprex package (v2.0.1)
Upvotes: 1