Bottom-up sets \(\tilde y = S \hat y_b\). The OLS and WLS routes
project the FULL base vector, letting the aggregate levels inform
the bottom – which bottom-up cannot do. Mirrors
morie.fn.johbu.
Usage
morie_reconcile_hierarchy(
y_hat_bottom = NULL,
S,
base = NULL,
method = "bottom_up",
residuals = NULL
)
Arguments
- y_hat_bottom
numeric bottom-level forecasts (bottom-up only).
- S
summing matrix (n x m).
- base
numeric base forecasts for all n series (projection
methods).
- method
"bottom_up", "ols" or "wls".
- residuals
matrix (T x n) of in-sample base residuals (wls).
Value
list: reconciled, bottom, coherent, P, n, m.
References
Wickramasuriya, S. L., Athanasopoulos, G. & Hyndman,
R. J. (2019). Optimal forecast reconciliation for hierarchical and
grouped time series through trace minimization. JASA, 114(526),
804-819.
Examples
S <- rbind(c(1, 1), c(1, 0), c(0, 1))
morie_reconcile_hierarchy(c(3, 4), S)$reconciled
#> [1] 7 3 4