Skip to contents

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 \(k\), it performs

  • a top-down approach for the aggregation orders \(<k\);

  • a bottom-up approach for the aggregation orders \(>k\).

Usage

temo(base, agg_order, order = max(agg_order), weights, tew = "sum",
     normalize = TRUE)

Arguments

base

A (\(hk \times 1\)) numeric vector containing the temporal aggregated base forecasts of order \(k\); \(k\) is an aggregation order (a factor of \(m\), and \(1<k<m\)), \(m\) is the max aggregation order, and \(h\) is the forecast horizon for the lowest frequency time series.

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\).

order

The intermediate fixed aggregation order \(k\).

weights

A (\(hm \times 1\)) numeric vector containing the proportions for the high-frequency time series; \(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.

Value

A (\(h(k^\ast+m) \times 1\)) numeric vector of temporal reconciled forecasts.

See also

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

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

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)