The problem
When your data has a hierarchy — stores inside regions inside a national total — forecasting each series on its own gives you numbers that don’t add up. The total forecast rarely equals the sum of the region forecasts, and the regions rarely equal the sum of their stores:Enabling it
Name the columns that form your hierarchy, top to bottom. You do not need an id column: the bottom-level series id is derived from the hierarchy values.region=north, store=store_1, the pipeline builds:
Aggregate series are summed from your data, forecast alongside the bottom
series, then reconciled. The output CSV carries every level, so one download
serves every audience.
Choosing a method
Bottom-up trusts the leaves: forecast each store, sum upward. Always
coherent, but noise in the leaves accumulates into the total.
Top-down trusts the root: forecast the total and split it by historical
proportions. Very stable, but it assumes those proportions still hold and
can’t react to a shock at one store.
MinT (Wickramasuriya et al., 2019) trusts everyone, weighted by their
uncertainty. It forecasts every node, then adjusts them all at once to the
coherent solution that minimizes total forecast-error variance — the trace
of
Var(ỹ − y), hence minimum trace. Because it uses information from
every level, it generally beats both alternatives.
MinT weights
weights picks how MinT estimates the error covariance W:
wls_var and shrink estimate W from real forecast errors, so the
pipeline runs an internal backtest first — each window in
residual_windows costs one extra inference pass. shrink is the variant
most used in the literature; wls_struct is the default here because it
needs no extra compute and holds up well. If the series are too short to
back-test, the run degrades to wls_struct and records a warning rather
than failing.
Top-down allocation
Whenmethod: top_down, top_down_method chooses how the total is split:
Reading the result
Job responses include areconciliation summary:
coherence_max_abs_error is the largest gap between any parent and the sum
of its children after reconciliation — it should be at floating-point noise.
Over the API
Pass the same block as a JSON form field. Sending the field at all enables reconciliation, soenabled is optional:
forecast tool takes the same JSON in its reconciliation
parameter. validate_dataset and profile_time_series report a
hierarchical flag plus the detected columns, so you can check whether your
data supports reconciliation before submitting.
Limits in this version
- Quantiles are reconciled per column. Each quantile column is coherent on its own, but the reconciled quantiles are not a coherent joint predictive distribution.
- No covariates. Reconciliation rejects user-declared and external covariates: an aggregate series has no meaningful value for them. Internal feature engineering still works, since those features are derived per series after the aggregates are built.
- No fine-tuning in combination with reconciliation.
- Single partition. A hierarchy can’t be split across workers, so a Ray or distributed runtime is forced to one partition.
- Hierarchy values must not contain the
separator(default/) or collide withtotal_label— the run fails fast with a message naming the column.