Hierarchical forecasting is the practice of predicting a collection of time series organized in aggregation levels, such as total sales, regional sales and store sales, and producing forecasts that are coherent, meaning that the lower-level forecasts add up exactly to the higher-level ones. Within time series and forecasting in artificial intelligence and statistics, it addresses a problem every large organization faces: different teams plan at different levels, yet their numbers must agree.
The data structure is often called a hierarchical time series. Forecasts produced independently at each level almost never sum correctly, so hierarchical methods add a reconciliation step that adjusts them into a consistent set, often improving accuracy as well.
How hierarchical time series are structured
A hierarchy is defined by a summing matrix, usually written S, that maps the most disaggregated series, the bottom level, to every aggregate above it. If b is the vector of bottom-level values, then all series together equal S multiplied by b. This linear constraint is the formal definition of coherence.
Many real collections are not a single tree. When products can be aggregated by category and also by region, the result is a grouped structure in which several hierarchies cross. Adding a time dimension, such as weekly, monthly and quarterly totals, creates temporal hierarchies. The table below compares these structures.
| Structure | Typical example | Key property |
|---|---|---|
| Strict hierarchy | Country, region, store | Each node has one parent |
| Grouped structure | Product category crossed with region | Several aggregation paths to the total |
| Temporal hierarchy | Weekly, monthly and quarterly demand | Same series at different frequencies |
| Cross-temporal structure | Store by product by month | Combines cross-sectional and temporal levels |
The size of a hierarchy grows quickly. A retailer with a few hundred stores and a few thousand products can easily reach hundreds of thousands of series, most of them short and sparse at the bottom. This imbalance of signal across levels is the central reason hierarchical methods exist: aggregates are smooth and predictable, while the bottom level holds the operational detail that planners actually need.
Approaches to hierarchical forecasting
There are four classic strategies for producing coherent forecasts, and they differ in which levels supply the information. Single-level methods forecast one level and derive the rest, while modern methods forecast every series and then reconcile them.
| Approach | How it works | Strength | Weakness |
|---|---|---|---|
| Bottom-up | Forecast bottom series, then sum | Keeps local detail | Bottom series are often noisy |
| Top-down | Forecast total, split by proportions | Stable aggregate signal | Loses local dynamics |
| Middle-out | Forecast a middle level, sum up and split down | Balances both ends | Choice of level is arbitrary |
| Optimal reconciliation | Forecast all series, then adjust jointly | Uses information from every level | Needs covariance estimates |
The most widely used reconciliation method is MinT, or minimum trace reconciliation. It projects the independent base forecasts onto the coherent subspace while minimizing the total forecast error variance, using an estimate of the base forecast error covariance. Simpler variants such as OLS reconciliation and WLS with structural scaling assume a diagonal or identity covariance and are more robust when the hierarchy has thousands of series.
Hierarchical forecasting with machine learning models
Machine learning changes hierarchical forecasting in two ways. First, global forecasting models such as gradient boosting or DeepAR learn across all bottom-level series at once, which makes bottom-up forecasts far less noisy than with one statistical model per series. Second, reconciliation can be built into training rather than applied afterward.
End-to-end methods add a coherence penalty to the loss function or include the reconciliation projection as a differentiable layer. Probabilistic variants reconcile entire forecast distributions, so that prediction intervals at each level remain consistent, which matters for inventory and capacity planning.
| Aspect | Classical pipeline | Machine learning pipeline |
|---|---|---|
| Base models | ETS or ARIMA per series | One global model across series |
| Reconciliation | Post-hoc MinT or OLS | Post-hoc or learned in training |
| Exogenous covariates | Limited per-series inputs | Rich shared features |
| Scale | Hundreds to thousands of series | Millions of series feasible |
| Interpretability | High | Moderate to low |
Choosing a method in practice
The right strategy depends on where the signal lives and how noisy the bottom level is. When bottom series are long and regular, bottom-up performs well. When they are sparse or intermittent, aggregate levels carry most of the predictable structure, and reconciliation that blends all levels usually wins.
| Situation | Recommended approach | Reason |
|---|---|---|
| Regular, high-volume bottom series | Bottom-up | Detailed patterns are reliable |
| Intermittent bottom demand | MinT or WLS reconciliation | Borrows strength from aggregates |
| Very large hierarchy | WLS structural scaling | Avoids unstable covariance estimates |
| Need for consistent intervals | Probabilistic reconciliation | Keeps uncertainty coherent |
| Only total matters operationally | Top-down with historical proportions | Simplicity outweighs detail |
Evaluation should use scale-free metrics such as MASE at every level, because absolute errors at the total level would otherwise dominate. Libraries including hts, fable and hierarchicalforecast implement the standard reconciliation methods.
Limitations and common pitfalls
- Negative reconciled forecasts can appear for small series, because linear projections ignore non-negativity; constrained or nonnegative reconciliation fixes this.
- Unstable covariance estimates in MinT arise when the number of series exceeds the history length; shrinkage estimators are the standard remedy.
- Changing hierarchies, such as new stores or discontinued products, require rebuilding the summing matrix and handling short histories.
- Evaluating only the total hides poor performance at the levels where operational decisions are made.
Reconciliation also cannot repair systematically biased base forecasts. If every base model misses a promotion effect, the reconciled forecasts will be coherent but still wrong, so base model quality remains the first priority.
A non-technical view
Imagine a company where each shop guesses its own sales for next month. The head office also makes its own guess for the whole country. The two sets of numbers rarely match. The shop guesses might add up to more than the national guess.
Hierarchical forecasting fixes this. It looks at all the guesses together and adjusts them gently. Every level then tells the same story. Shops, regions and the head office can plan with numbers that agree.
A concrete example
A grocery chain with 400 stores in 12 regions forecasts weekly demand for about 2,000 products, which gives roughly 800,000 bottom-level series. Warehouses order stock by region, stores staff by store total, and finance budgets at the national level.
The team trains one global gradient boosting model on all store-product series with price, promotion and holiday features, and separately forecasts regional and national totals. They then apply WLS reconciliation with structural scaling, because full MinT covariance estimation is unstable at this size, and clip small negative values to zero.
After reconciliation, regional warehouse forecasts improve noticeably on MASE compared with simple bottom-up sums, and finance, logistics and store managers now work from one consistent plan instead of three conflicting ones.