temo function

Temporal middle-out reconciliation

Temporal middle-out reconciliation

The middle-out forecast reconciliation for temporal hierarchies combines top-down (tetd ) and bottom-up (tebu ) methods. Given the base forecasts of an intermediate temporal aggregation order kk, it performs

  • a top-down approach for the aggregation orders \<k\<k;
  • a bottom-up approach for the aggregation orders k\>k.
temo(base, agg_order, order = max(agg_order), weights, tew = "sum", normalize = TRUE)

Arguments

  • base: A (hk×1hk \times 1) numeric vector containing the temporal aggregated base forecasts of order kk; kk is an aggregation order (a factor of mm, and 1<k<m1<k<m), mm is the max 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.
  • order: The intermediate fixed aggregation order kk.
  • weights: A (hm×1hm \times 1) numeric vector containing the proportions for the high-frequency time series; mm is the max aggregation order, and hh 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 (h(k+m)×1h(k^\ast+m) \times 1) numeric vector of temporal reconciled forecasts.

Examples

set.seed(123) # (6 x 1) base forecasts vector (simulated), forecast horizon = 3 # and intermediate aggregation order k = 2 (max agg order = 4) basek2 <- rnorm(3*2, 5) # Same weights for different forecast horizons fix_weights <- runif(4) reco <- temo(base = basek2, order = 2, agg_order = 4, weights = fix_weights) # Different weights for different forecast horizons h_weights <- runif(4*3) recoh <- temo(base = basek2, order = 2, agg_order = 4, weights = h_weights)

See Also

Middle-out reconciliation: csmo(), ctmo()

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