Problem
Teams often forecast a metric at several levels at once: total sales, sales per category, sales per product. If one model is trained per series, the forecasts do not add up. Stakeholders see a category forecast that differs from the sum of its products. In the example the gap is 0.18, but the author notes it can reach thousands on harder series with larger numbers.
Example from the article: a pet shop forecasts weekly sales for five products (cat food A and B, dog food C, D and E), two categories and the total. Eight independent exponential smoothing models give 93.85 + 160.42 = 254.27 for cat food, while the direct cat food model says 254.45. The data are synthetic.
Solution in brief
Train models as usual, then reconcile the forecasts in a second step. Every reconciliation method is one matrix multiplication . The summing matrix is fixed by the hierarchy, and the mapping matrix defines the method (bottom-up, top-down or an optimized one such as MinT).
Questions this case answers
- How to produce forecasts for a hierarchy of related series so that the parts add up to the totals when each series is modeled independently
- How to make independently forecast category and product sales add up?
- How to choose between bottom-up and top-down forecasts for a hierarchy of metrics?
- How to express any reconciliation method as one matrix multiplication?
Tools and methods
- Bottom-up reconciliation — forecast only the lowest level and sum upward
- Top-down reconciliation — forecast only the top and split by historical shares
- Summing matrix S and mapping matrix M — encodes the hierarchy, the method
- MinT (minimum trace) — optimal choice of from the literature
- Exponential smoothing — base model in the example
- sktime — library with these reconciliation methods
Google or a one-time email code. No password.