tebu function

Temporal bottom-up reconciliation

Temporal bottom-up reconciliation

Temporal bottom-up reconciled forecasts at any temporal aggregation level are computed by appropriate aggregation of the high-frequency base forecasts, x^[1]\widehat{\mathbf{x}}^{[1]}: [REMOVE_ME]x~=Stex^[1],[REMOVEME2] \widetilde{\mathbf{x}} = \mathbf{S}_{te}\widehat{\mathbf{x}}^{[1]}, [REMOVE_ME_2]

where Ste\mathbf{S}_{te} is the temporal structural matrix.

tebu(base, agg_order, tew = "sum", sntz = FALSE)

Arguments

  • base: A (hm×1hm \times 1) numeric vector containing the high-frequency base forecasts; mm is the max. temporal aggregation order, and hh is the forecast horizon for the lowest frequency time series.
  • 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 (h(k+m)×1h(k^\ast+m) \times 1) numeric vector of temporal reconciled forecasts.

Description

Temporal bottom-up reconciled forecasts at any temporal aggregation level are computed by appropriate aggregation of the high-frequency base forecasts, x^[1]\widehat{\mathbf{x}}^{[1]}:

x~=Stex^[1], \widetilde{\mathbf{x}} = \mathbf{S}_{te}\widehat{\mathbf{x}}^{[1]},

where Ste\mathbf{S}_{te} is the temporal structural matrix.

Examples

set.seed(123) # (4 x 1) high frequency base forecasts vector (simulated), # agg_order = 4 (annual-quarterly) hfts <- rnorm(4, 5) reco <- tebu(base = hfts, agg_order = 4) # Non negative reconciliation hfts[4] <- -hfts[4] # Making negative one of the quarterly base forecasts nnreco <- tebu(base = hfts, agg_order = 4, sntz = TRUE)

See Also

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

Temporal framework: teboot(), tecov(), telcc(), temo(), terec(), tetd(), tetools()