fb.Fernando Barbosa

FIELD NOTE / HIERARCHICAL FORECASTING

Forecasts that add up.

A forecast is a decision system when every level must agree: the global outlook, the business unit, and the underlying series.

Explore forecast reconciliation ↓
GLOBAL TOTAL
GROUP AGROUP B
A1A2B1B2

One coherent view
at every level.

01 / THE PROBLEM

One business. Many views of demand.

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.

DELIVERY EXPERIENCEDailyhierarchical forecasting for the global Cellulosics business at IFF

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.

01 / STRUCTURE

Make the hierarchy explicit

Represent how lower-level series aggregate. A summing matrix encodes which components contribute to each total.

02 / MODEL

Forecast at useful levels

NeuralForecast provides neural forecasting models, including NHITS. Model choice still needs time-aware validation against strong baselines.

03 / RECONCILE

Restore coherence

Reconciliation maps base forecasts to values that obey the hierarchy. Coherence is guaranteed by construction; improved accuracy must be measured.

02 / INTERACTIVE DEMO

Where did the total come from?

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.

HierarchyBaseCurrent outputValue 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.

03 / RECONCILIATION CHOICES

Coherence is a constraint. Accuracy is a test.

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.

BOTTOM-UP

Preserve the leaves

Keep the bottom-level forecasts, then sum upward. Straightforward and coherent; aggregate-level information from separate forecasts is not used.

TOP-DOWN

Allocate from the top

Forecast the aggregate, then distribute it down the hierarchy. The shares matter and can obscure bottom-level patterns.

MINT / MINTRACE

Use error structure

Project base forecasts onto the coherent space while accounting for forecast-error covariance. Estimating that structure well is part of the modeling work.

NIXTLA · PYTHON WORKFLOW SKETCHMODEL ≠ RECONCILER
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 ↗

04 / SOURCES

Read the method, not just the output.

These references explain the library workflow, reconciliation methods and the statistical basis for MinT.

OFFICIAL TUTORIAL

Hierarchical Forecast with NeuralForecast

Nixtla’s worked example demonstrates HINT with NHITS and compares BottomUp and MinTrace reconciliation on a public tourism hierarchy.

Open the tutorial ↗
OFFICIAL DOCUMENTATION

NeuralForecast introduction

Overview of neural model families, probabilistic forecasts and the library’s workflow.

Read the introduction ↗
LIBRARY METHODS

HierarchicalForecast

Python methods include BottomUp, TopDown, MiddleOut, MinTrace, ERM and probabilistic reconciliation tools.

Browse the library ↗
PEER-REVIEWED RESEARCH

Wickramasuriya, Athanasopoulos & Hyndman · 2019

“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

Forecasting starts with the decision.