cttd | R Documentation |
Top-down forecast reconciliation for cross-temporal hierarchical/grouped time series, where the forecast of a ‘Total’ (top-level series, expected to be positive) is disaggregated according to a proportional scheme (weights). Besides fulfilling any aggregation constraint, the top-down reconciled forecasts should respect two main properties:
the top-level value remains unchanged;
all the bottom time series reconciled forecasts are non-negative.
cttd(base, agg_mat, agg_order, weights, tew = "sum", normalize = TRUE)
base |
A ( |
agg_mat |
A ( |
agg_order |
Highest available sampling frequency per seasonal cycle (max. order
of temporal aggregation, |
weights |
A ( |
tew |
A string specifying the type of temporal aggregation. Options include:
" |
normalize |
If |
A (n \times h(k^\ast+m)
) numeric matrix of cross-temporal reconciled forecasts.
Top-down reconciliation:
cstd()
,
tetd()
Cross-temporal framework:
ctboot()
,
ctbu()
,
ctcov()
,
ctlcc()
,
ctmo()
,
ctrec()
,
cttools()
,
iterec()
,
tcsrec()
set.seed(123)
# (3 x 1) top base forecasts vector (simulated), forecast horizon = 3
topf <- rnorm(3, 10)
A <- t(c(1,1)) # Aggregation matrix for Z = X + Y
# Same weights for different forecast horizons, agg_order = 4
fix_weights <- matrix(runif(4*2), 2, 4)
reco <- cttd(base = topf, agg_mat = A, agg_order = 4, weights = fix_weights)
# Different weights for different forecast horizons
h_weights <- matrix(runif(4*2*3), 2, 3*4)
recoh <- cttd(base = topf, agg_mat = A, agg_order = 4, weights = h_weights)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.