Make the hierarchy explicit
Represent how lower-level series aggregate. A summing matrix encodes which components contribute to each total.
FIELD NOTE / HIERARCHICAL FORECASTING
A forecast is a decision system when every level must agree: the global outlook, the business unit, and the underlying series.
Explore forecast reconciliation ↓One coherent view
at every level.
Teams forecast at different levels for different decisions. If each series is modeled independently, the global forecast may not equal the sum of its components. That gap creates avoidable disagreement in planning, capacity and inventory conversations.
At IFF, I led a three-person project team delivering a hierarchical forecasting tool that produced daily predictions for the global Cellulosics business. My work included the forecasting architecture, cloud implementation and project infrastructure.
This page demonstrates the reconciliation problem with invented series and values. It contains no IFF data, model, source code, accuracy result or production design.
Represent how lower-level series aggregate. A summing matrix encodes which components contribute to each total.
NeuralForecast provides neural forecasting models, including NHITS. Model choice still needs time-aware validation against strong baselines.
Reconciliation maps base forecasts to values that obey the hierarchy. Coherence is guaranteed by construction; improved accuracy must be measured.
Switch methods to see how a fictional global total and its groups change. All base forecasts, series labels and proportions below are synthetic.
Base forecasts are produced independently; parent and child values may not add up.
| Hierarchy | Base | Current output | Value profile |
|---|
Read this carefully: this is an in-browser teaching example, not a trained NeuralForecast model. It uses fixed, invented point forecasts to explain coherence. Its OLS option is a simple least-squares projection with identity error weights; it is not covariance-estimated MinT or evidence that reconciliation improves accuracy.
Bottom-up sums bottom-level forecasts. Top-down allocates an aggregate forecast using proportions. MinT methods choose coherent values using forecast-error covariance assumptions. Each approach has tradeoffs; compare them out of sample at the levels and horizons where decisions are made.
Keep the bottom-level forecasts, then sum upward. Straightforward and coherent; aggregate-level information from separate forecasts is not used.
Forecast the aggregate, then distribute it down the hierarchy. The shares matter and can obscure bottom-level patterns.
Project base forecasts onto the coherent space while accounting for forecast-error covariance. Estimating that structure well is part of the modeling work.
import numpy as np
from neuralforecast import NeuralForecast
from neuralforecast.models import NHITS, HINT
from neuralforecast.losses.pytorch import GMM, sCRPS
from hierarchicalforecast.core import HierarchicalReconciliation
from hierarchicalforecast.methods import BottomUp, MinTrace
# HINT combines a neural base model with hierarchy-aware reconciliation.
quantiles = np.array([0.1, 0.5, 0.9])
base = NHITS(
h=horizon,
input_size=24,
loss=GMM(n_components=10, quantiles=quantiles),
valid_loss=sCRPS(quantiles=quantiles),
max_steps=2000,
)
hint = HINT(
h=horizon,
S=S_df.drop(columns="unique_id").to_numpy(),
model=base,
reconciliation="BottomUp",
)
nf = NeuralForecast(models=[hint], freq="MS")
nf.fit(df=train_df, val_size=horizon)
hint_forecasts = nf.predict()
# Compare independent forecasts reconciled with alternative methods.
reconcilers = [
BottomUp(),
MinTrace(method="mint_shrink"),
]
reconciler = HierarchicalReconciliation(reconcilers=reconcilers)
coherent = reconciler.reconcile(
Y_hat_df=Y_hat_df,
Y_df=Y_fitted_df,
S=S_df,
tags=tags,
)
Workflow sketch based on Nixtla’s current tutorial. Dataset preparation and fitted residuals are omitted; adapt to the actual hierarchy, forecasting horizon and library versions before running. Open the runnable Python example ↗
These references explain the library workflow, reconciliation methods and the statistical basis for MinT.
Nixtla’s worked example demonstrates HINT with NHITS and compares BottomUp and MinTrace reconciliation on a public tourism hierarchy.
Open the tutorial ↗Overview of neural model families, probabilistic forecasts and the library’s workflow.
Read the introduction ↗Python methods include BottomUp, TopDown, MiddleOut, MinTrace, ERM and probabilistic reconciliation tools.
Browse the library ↗“Optimal forecast reconciliation for hierarchical and grouped time series through trace minimization.” The MinT paper in the Journal of the American Statistical Association.
Read the paper ↗References establish methods and context; they do not validate the historical IFF project or its results. The demo is synthetic. No accuracy improvement is claimed.
CONTINUE EXPLORING