HierarchicalForecast

HierarchicalForecast is an open-source Python library from Nixtla that provides a collection of reconciliation methods, datasets, evaluation metrics, and visualization tools for hierarchical time series forecasting.

Reviewed by 7wData

On this page

Publisher review

HierarchicalForecast is an open-source Python library from Nixtla that provides a collection of reconciliation methods, datasets, evaluation metrics, and visualization tools for hierarchical time series forecasting. It is designed for data scientists and forecasters who need to produce coherent forecasts across multiple levels of aggregation—such as geographic regions, product categories, or organizational hierarchies—where the sum of bottom-level forecasts must equal the top-level aggregate. The library implements a two-stage reconciliation process: first, base forecasts are generated for all series (using any forecasting method, including those from Nixtla's StatsForecast or DatasetsForecast), then these forecasts are reconciled to enforce coherence.

The library supports both cross-sectional hierarchies (e.g., country → state → region) and temporal hierarchies (e.g., daily → weekly → monthly). It includes classic methods like BottomUp and TopDown, alternative methods like MiddleOut, MinTrace, and ERM (Expectile Reconciliation Method), and probabilistic coherent methods such as Normality, Bootstrap, PERMBU, and Conformal. Temporal reconciliation methods are also available.

The package ships with a curated set of standard statistical baselines (e.g., ETS, ARIMA) and publicly available processed datasets for benchmarking. Evaluation metrics are built in, allowing users to compare the accuracy and coherence of reconciled forecasts. The library integrates seamlessly with other Nixtla tools: StatsForecast for generating base forecasts and DatasetsForecast for accessing preprocessed hierarchical datasets.

It is released under a permissive license and has accumulated 745 stars and 97 forks on GitHub as of May 2026, with 523 commits in its main branch. The project is actively maintained, with recent updates including the deprecation of Numba in favor of C++ for performance improvements and the addition of the EMinT reconciliation method. HierarchicalForecast is positioned as a more comprehensive alternative to scikit-hts, which offers a narrower set of reconciliation methods and has 226 stars on GitHub.

While HierarchicalForecast excels in breadth of reconciliation techniques and integration with the Nixtla ecosystem, it does not provide built-in base forecasting models—users must supply their own base forecasts or use StatsForecast separately. Additionally, the library's documentation, while thorough, can be dense for newcomers unfamiliar with hierarchical forecasting concepts. There is no explicit pricing information available, but as an open-source project, it is free to use under its license.

The library is owned and maintained by Nixtla, the same company behind StatsForecast and the broader Nixtla forecasting ecosystem. For users seeking a lightweight alternative with simpler API, scikit-hts may be a better fit, but HierarchicalForecast offers a richer set of reconciliation methods and better support for probabilistic and temporal hierarchies.

Get the AI & data signal, daily.

335k+ subscribers read this every morning. One email, both newsletters. Unsubscribe anytime.

How it works

  1. Classic reconciliation methods

    Implements BottomUp and TopDown approaches for enforcing coherence across hierarchical levels using aggregation matrices.

  2. Alternative reconciliation methods

    Includes MiddleOut, MinTrace (minimum trace), and ERM (Expectile Reconciliation Method) for more flexible coherence constraints.

  3. Probabilistic coherent methods

    Supports Normality, Bootstrap, PERMBU, and Conformal methods to generate coherent probabilistic forecasts across hierarchies.

  4. Temporal reconciliation methods

    Enables reconciliation across temporal hierarchies (e.g., daily to weekly to monthly) in addition to cross-sectional hierarchies.

  5. Integrated datasets and baselines

    Provides publicly available processed datasets and a curated set of standard statistical baselines (ETS, ARIMA) for benchmarking.

  6. Evaluation metrics

    Includes built-in metrics to assess forecast accuracy and coherence, enabling direct comparison of reconciliation methods.

  7. Nixtla ecosystem integration

    Works with StatsForecast for base forecasts and DatasetsForecast for dataset handling, forming a unified forecasting pipeline.

Strengths and trade-offs

Strengths

  • Provides over 10 distinct reconciliation methods, including classic, alternative, and probabilistic approaches, covering a broader range than most alternatives.
  • Supports both cross-sectional and temporal hierarchies, allowing users to reconcile forecasts across multiple aggregation levels and time granularities simultaneously.
  • Integrates directly with StatsForecast and DatasetsForecast, enabling a seamless workflow from base forecasting to reconciliation without manual data wrangling.
  • Includes built-in evaluation metrics and curated benchmark datasets, making it easy to compare the accuracy and coherence of different reconciliation strategies.

Trade-offs

  • Does not include built-in base forecasting models; users must supply their own base forecasts or use a separate library like StatsForecast.
  • Documentation can be dense and assumes familiarity with hierarchical forecasting concepts, which may be a barrier for newcomers.
  • The library is relatively new compared to scikit-hts, so community resources and third-party tutorials are still limited.
  • Performance for very large hierarchies (e.g., thousands of bottom-level series) may require optimization, as the reconciliation step can become computationally expensive.

Pricing context

Free and open-source under a permissive license; no paid tiers or enterprise versions are mentioned in the provided sources.

Getting started with HierarchicalForecast

  1. Install HierarchicalForecast

    Install the library via pip by running `pip install hierarchicalforecast` in your terminal. This command also installs required dependencies like NumPy and Pandas. Ensure you have Python 3.8 or later installed.

  2. Load a hierarchical dataset

    Import the library and load a built-in dataset using `from hierarchicalforecast.datasets import HierarchicalDataset`. For example, call `dataset = HierarchicalDataset.load('tourism')` to access a preprocessed tourism hierarchy with multiple aggregation levels.

  3. Generate base forecasts

    Use StatsForecast or another forecasting library to produce base forecasts for each series in the hierarchy. For instance, fit an ETS model to each bottom-level series and store the forecasts in a DataFrame with columns for each series and time index.

  4. Reconcile forecasts with MinTrace

    Import the `MinTrace` reconciler from `hierarchicalforecast.reconciliation`. Instantiate it with the aggregation matrix `S` and call `reconciler.reconcile(base_forecasts)` to produce coherent forecasts that minimize trace of the covariance matrix.

  5. Evaluate reconciled forecasts

    Use the built-in evaluation metrics from `hierarchicalforecast.evaluation` to compare reconciled forecasts against actuals. Compute metrics like Mean Absolute Scaled Error (MASE) and coherence error to assess accuracy and hierarchy consistency.

Frequently Asked Questions

What is HierarchicalForecast?

HierarchicalForecast is an open-source Python library from Nixtla that provides reconciliation methods, datasets, evaluation metrics, and visualization tools for hierarchical time series forecasting. It helps produce coherent forecasts across multiple levels of aggregation, such as geographic regions or product categories.

What reconciliation methods does HierarchicalForecast support?

HierarchicalForecast supports classic methods like BottomUp and TopDown, alternative methods like MiddleOut, MinTrace, and ERM, and probabilistic coherent methods such as Normality, Bootstrap, PERMBU, and Conformal. It also includes temporal reconciliation methods for time-based hierarchies.

Does HierarchicalForecast include built-in forecasting models?

No, HierarchicalForecast does not include built-in base forecasting models. Users must supply their own base forecasts or use a separate library like StatsForecast from Nixtla. This allows flexibility in choosing forecasting methods while focusing on reconciliation.

How does HierarchicalForecast compare to scikit-hts?

HierarchicalForecast offers a broader range of reconciliation methods, including probabilistic and temporal approaches, and integrates with the Nixtla ecosystem. It has more GitHub stars (745 vs. 226) but is newer. scikit-hts is simpler and may be better for lightweight use cases.

What are the main strengths of HierarchicalForecast?

Key strengths include over 10 reconciliation methods, support for both cross-sectional and temporal hierarchies, seamless integration with StatsForecast and DatasetsForecast, and built-in evaluation metrics and benchmark datasets for easy comparison of reconciliation strategies.

What are the limitations of HierarchicalForecast?

Limitations include no built-in base forecasting models, dense documentation that assumes familiarity with hierarchical forecasting, limited community resources due to its newness, and potential performance issues for very large hierarchies with thousands of bottom-level series.

Alternatives

How HierarchicalForecast compares

Direct head-to-head against 3 competitors. Picked by 7wData.

This tool

HierarchicalForecast

Pricing
Free and open-source under a permissive license; no paid tiers or enterprise versions are mentioned in the provided sources.
Target
HierarchicalForecast is an open-source Python library from Nixtla that provides a collection of reconciliation methods, datasets, evaluation metrics, and visualization tools for hierarchical time series
Strength
Provides over 10 distinct reconciliation methods, including classic, alternative, and probabilistic approaches, covering a broader range than most alternatives.
Watch for
Does not include built-in base forecasting models; users must supply their own base forecasts or use a separate library like StatsForecast.

statsforecast

Pricing
Free (open source, MIT license)
Target
Time series forecasting with statistical models
Deployment
Python library, pip install
Strength
Wide range of baseline models (AutoARIMA, ETS, Theta) for fast prototyping
Watch for
Limited hierarchical reconciliation; requires separate hierarchicalforecast package

Prophet

Pricing
Free (open source, MIT license)
Target
Time series forecasting with changepoints and seasonality
Deployment
Python/R library, pip install
Strength
Handles missing data and outliers with automatic changepoint detection
Watch for
No native hierarchical reconciliation; needs custom aggregation logic

Gretel.ai

Pricing
Free tier; paid plans from $0.30/credit
Target
Synthetic data generation for hierarchical time series
Deployment
Cloud API, Python SDK
Strength
Generates synthetic hierarchical data for testing and augmentation
Watch for
Not a forecasting tool; focuses on data generation, not reconciliation

User reviews

No user reviews yet. Be the first to write one.

Sources

Reporting on this tool draws on these publicly available sources.

  1. nixtlaverse.nixtla.io
  2. github.com
  3. manjubnm.medium.com
  4. www.nixtla.io