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.
base: A (hm×1) numeric vector containing top- and m temporal aggregated level base forecasts; m is the max aggregation order, and h is the forecast horizon for the lowest frequency time series.
agg_mat: A (na×nb) numeric matrix representing the cross-sectional aggregation matrix. It maps the nb bottom-level (free) variables into the na upper (constrained) variables.
agg_order: Highest available sampling frequency per seasonal cycle (max. order of temporal aggregation, m), or a vector representing a subset of p factors of m.
weights: A (nb×hm) numeric matrix containing the proportions for each high-frequency bottom time series; nb is the total number of high-frequency bottom variables, m is the max aggregation order, and h is the forecast horizon for the lowest frequency time series.
tew: A string specifying the type of temporal aggregation. Options include: "sum" (simple summation, default), "avg" (average), "first" (first value of the period), and "last" (last value of the period).
normalize: If TRUE (default), the weights will sum to 1.
Returns
A (n×h(k∗+m)) numeric matrix of cross-temporal reconciled forecasts.
Examples
set.seed(123)# (3 x 1) top base forecasts vector (simulated), forecast horizon = 3topf <- rnorm(3,10)A <- t(c(1,1))# Aggregation matrix for Z = X + Y# Same weights for different forecast horizons, agg_order = 4fix_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 horizonsh_weights <- matrix(runif(4*2*3),2,3*4)recoh <- cttd(base = topf, agg_mat = A, agg_order =4, weights = h_weights)