Nixtla/hierarchicalforecast

Probabilistic Hierarchical forecasting 👑 with statistical and econometric methods.

What it solves

It addresses the problem of inconsistency in time series forecasts when data is organized in hierarchies (such as geographical regions, product categories, or temporal scales like weeks and months). When forecasts are made independently for each level, the sums of the lower-level forecasts often do not match the totals of the higher-level forecasts. This library provides methods to reconcile these predictions so they are coherent across all levels.

How it works

The library takes "base forecasts" (initial predictions) and applies reconciliation algorithms to adjust them. It supports several approaches:

  • Classic Methods: BottomUp (summing lower levels to create upper levels) and TopDown (distributing top-level forecasts downward).
  • Alternative Methods: MiddleOut (anchoring predictions at a middle level), MinTrace (minimizing total forecast variance), and ERM (using L1 regularization).
  • Probabilistic Methods: Tools like Normality, Bootstrap, PERMBU, and Conformal prediction to provide distribution-free or assumption-based prediction intervals.
  • Temporal Reconciliation: Most of these methods can also be applied to temporal hierarchies (e.g., reconciling daily forecasts with monthly totals).

Who it’s for

Data scientists, econometricians, and ML engineers working with hierarchical time series data in industry or academia who need consistent, coherent predictions across different aggregation levels.

Highlights

  • Supports both cross-sectional and temporal hierarchies.
  • Includes a wide range of statistical and econometric reconciliation methods.
  • Provides probabilistic coherent prediction methods for uncertainty estimation.
  • Integrates with the Nixtla ecosystem (e.g., statsforecast and datasetsforecast).

Related

  • Project
  • Project
  • Project
  • Project
  • Project