Cross-temporal bottom-up reconciled forecasts for all series at any temporal aggregation level are computed by appropriate summation of the high-frequency bottom base forecasts B[1]: [REMOVE_ME]X=ScsB[1]Ste′,[REMOVEME2]
where Scs and Ste are the cross-sectional and temporal structural matrices, respectively.
base: A (nb×hm) numeric matrix containing high-frequency bottom base forecasts; 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.
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.
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).
sntz: If TRUE, the negative base forecasts are set to zero before applying bottom-up.
Returns
A (n×h(k∗+m)) numeric matrix of cross-temporal reconciled forecasts.
Description
Cross-temporal bottom-up reconciled forecasts for all series at any temporal aggregation level are computed by appropriate summation of the high-frequency bottom base forecasts B[1]:
X=ScsB[1]Ste′,
where Scs and Ste are the cross-sectional and temporal structural matrices, respectively.
Examples
set.seed(123)# Aggregation matrix for Z = X + YA <- t(c(1,1))# (2 x 4) high frequency bottom base forecasts matrix (simulated),# agg_order = 4 (annual-quarterly)hfbts <- matrix(rnorm(4*2,2.5),2,4)reco <- ctbu(base = hfbts, agg_mat = A, agg_order =4)# Non negative reconciliationhfbts[1,4]<--hfbts[1,4]# Making negative one of the quarterly base forecasts for variable Xnnreco <- ctbu(base = hfbts, agg_mat = A, agg_order =4, sntz =TRUE)