Hierarchical Forecasting & Reconciliation
A hierarchical time series is a collection of series organized in an aggregation structure: individual SKU sales sum to product-category sales, which sum to regional sales, which sum to national totals. Forecasting each level independently produces incoherent forecasts — the summed level-2 forecasts don't equal the level-1 forecast. Reconciliation methods project the base forecasts onto the coherent subspace where all aggregation constraints hold.
The summing matrix
Let = total number of series across all levels, = number of bottom-level series. The summing matrix () encodes the aggregation structure:
where are the bottom-level series values and are all series (top + intermediate + bottom).
Example: 1 total, 2 regions, 4 bottom-level stores (n=7, m=4):
A set of forecasts is coherent if and only if for some .
Approach 1: Top-down
Produce a forecast only at the top level , then disaggregate using historical proportions (fraction of total attributable to series ):
Proportions options:
- Average historical proportions:
- Proportions from the last period
- Forecasted proportions (using a separate model)
When to use: When bottom-level series are sparse or noisy and the aggregate is well-behaved.
Limitation: Forces bottom-level forecasts to inherit the top-level model's biases.
Approach 2: Bottom-up
Forecast each bottom-level series independently, then aggregate:
When to use: When bottom-level series have sufficient history and you trust the granular models.
Limitation: Aggregation propagates and amplifies bottom-level errors.
Approach 3: MinT (Minimum Trace) reconciliation
Optimal reconciliation finds the coherent forecast closest (in MSE) to the base forecasts :
where is the covariance matrix of base forecast errors .
Derivation intuition: This is generalized least squares (GLS) projecting onto the coherent subspace . The weighting by ensures that high-variance forecasts are trusted less in the reconciliation.
Estimating W
Estimating the full covariance from historical forecast errors is expensive for large hierarchies. Common approximations:
| Method | Complexity | |
|---|---|---|
| OLS | (identity) | : simple average |
| WLS (variance scaling) | : series-wise variance | |
| MinT (shrinkage) | Shrinkage estimator of full covariance | |
| MinT (sample) | Sample covariance from rolling residuals |
For large hierarchies (), WLS with variance scaling is the practical choice; it captures most of the gain from MinT at a fraction of the cost.
Worked example
Setup: a minimal hierarchy — 1 national series that must equal the sum of 2 regional series. Each series is forecast independently, giving base predictions:
| Series | Base forecast () |
|---|---|
| National | 100 |
| Region A | 58 |
| Region B | 47 |
These are incoherent: the regions sum to , but the independently forecast national total is . They disagree by 5, and no single set of numbers is actionable until they are reconciled.
For this reduced hierarchy the summing matrix and base vector are
MinT reconciliation with OLS () projects onto the coherent subspace via with . The pieces:
Applying the projection:
The reconciled forecasts are now coherent () and each is the L2-closest coherent value to the base forecast. The reconciliation spread the 5-unit gap across all three series: the national estimate rose from 100 to 101.7 while both regions were pulled down slightly. Under OLS every series is trusted equally; WLS or full MinT would instead pull hardest on the highest-variance (least-trusted) forecasts.
Software
- Python:
statsforecastpackage providesMinT,TopDown,BottomUpvia theHierarchicalReconciliationclass. - R:
fablepackage,reconcile()function withMinT()/ETS()methods. - Reference: Wickramasuriya et al. (2019) "Optimal Forecast Reconciliation Using Unbiased Mapping."
Related concepts
- Demand Forecasting in Production: where hierarchical reconciliation is deployed on real SKU / region / channel hierarchies
- ARIMA Order Selection: the base-forecast models whose independent outputs get reconciled
- Walk-Forward Validation: evaluating whether reconciliation actually improved forecast accuracy