ctbu function

Cross-temporal bottom-up reconciliation

Cross-temporal bottom-up reconciliation

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]^\widehat{\mathbf{B}^{[1]}}: [REMOVE_ME]X~=ScsB[1]^Ste,[REMOVEME2] \widetilde{\mathbf{X}} = \mathbf{S}_{cs}\widehat{\mathbf{B}^{[1]}}\mathbf{S}'_{te}, [REMOVE_ME_2]

where Scs\mathbf{S}_{cs} and Ste\mathbf{S}_{te} are the cross-sectional and temporal structural matrices, respectively.

ctbu(base, agg_mat, agg_order, tew = "sum", sntz = FALSE)

Arguments

  • base: A (nb×hmn_b \times hm) numeric matrix containing high-frequency bottom base forecasts; nbn_b is the total number of high-frequency bottom variables, mm is the max aggregation order, and hh is the forecast horizon for the lowest frequency time series.
  • agg_mat: A (na×nbn_a \times n_b) numeric matrix representing the cross-sectional aggregation matrix. It maps the nbn_b bottom-level (free) variables into the nan_a upper (constrained) variables.
  • agg_order: Highest available sampling frequency per seasonal cycle (max. order of temporal aggregation, mm), or a vector representing a subset of pp factors of mm.
  • 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)n \times h(k^\ast+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]^\widehat{\mathbf{B}^{[1]}}:

X~=ScsB[1]^Ste, \widetilde{\mathbf{X}} = \mathbf{S}_{cs}\widehat{\mathbf{B}^{[1]}}\mathbf{S}'_{te},

where Scs\mathbf{S}_{cs} and Ste\mathbf{S}_{te} are the cross-sectional and temporal structural matrices, respectively.

Examples

set.seed(123) # Aggregation matrix for Z = X + Y A <- 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 reconciliation hfbts[1,4] <- -hfbts[1,4] # Making negative one of the quarterly base forecasts for variable X nnreco <- ctbu(base = hfbts, agg_mat = A, agg_order = 4, sntz = TRUE)

See Also

Bottom-up reconciliation: csbu(), tebu()

Cross-temporal framework: ctboot(), ctcov(), ctlcc(), ctmo(), ctrec(), cttd(), cttools(), iterec(), tcsrec()