| tesmp | R Documentation |
This function performs temporal probabilistic forecast
reconciliation using a sample-based approach (Girolimetto et al., 2024) for
a single time series using temporal hierarchies (Athanasopoulos et al.,
2017). Given a (L \times h(k^\ast + m)) matrix of simulated base
forecast draws, tesmp() applies a chosen FoReco temporal
reconciliation independently to each draw, producing a coherent sample
distribution of reconciled forecasts across the temporal hierarchy. Typical
choices for the reconciliation include optimal combination (terec) as well
as top-down (tetd), middle-out (temo), bottom-up (tebu), and
level-conditional (telcc) approaches.
tesmp(sample, agg_order, fun = terec, ...)
sample |
A ( |
agg_order |
Highest available sampling frequency per seasonal cycle
(max. order of temporal aggregation, |
fun |
A string specifying the reconciliation function to be used, as implemented in FoReco. |
... |
Arguments passed on to |
A distributional::dist_sample object.
Athanasopoulos, G., Hyndman, R.J., Kourentzes, N. and Petropoulos, F. (2017), Forecasting with Temporal Hierarchies, European Journal of Operational Research, 262, 1, 60-74. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1016/j.ejor.2017.02.046")}
Girolimetto, D., Athanasopoulos, G., Di Fonzo, T. and Hyndman, R.J. (2024), Cross-temporal probabilistic forecast reconciliation: Methodological and practical issues. International Journal of Forecasting, 40, 3, 1134-1151. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1016/j.ijforecast.2023.10.003")}
Probabilistic reconciliation:
csmvn(),
cssmp(),
ctmvn(),
ctsmp(),
temvn()
Temporal framework:
teboot(),
tebu(),
tecov(),
telcc(),
temo(),
temvn(),
terec(),
tetd(),
tetools()
set.seed(123)
m <- 4 # from quarterly to annual temporal aggregation
# (100 x 14) base forecasts sample matrix (simulated), m = 4, h = 2
sample <- t(sapply(1:100, function(x) {
rnorm(14, rep(c(20, 10, 5), 2 * c(1, 2, 4)))
}))
# (70 x 1) in-sample residuals vector (simulated)
res <- rnorm(70)
# Top-down probabilistic reconciliation
reco_dist_td <- tesmp(sample[,c(1:2), drop = FALSE], agg_order = m,
fun = tetd, weights = c(0.2, 0.5, 0.3, 0.3))
# Middle-out probabilistic reconciliation
reco_dist_mo <- tesmp(sample[,c(3:6), drop = FALSE], agg_order = m,
fun = temo, weights = c(0.2, 0.5, 0.3, 0.3), order = 2)
# Bottom-up probabilistic reconciliation
reco_dist_bu <- tesmp(sample[,-c(1:6)], agg_order = m, fun = tebu)
# Level conditional coherent probabilistic reconciliation
reco_dist_lcc <- tesmp(sample, agg_order = m, fun = telcc)
# Optimal cross-sectional probabilistic reconciliation
reco_dist_opt <- tesmp(sample, agg_order = m, res = res, comb = "wlsv")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.