Skip to main content
← CONCEPTS / DATA-ENGINEERING
An end-to-end domain learning journey

Hierarchical Demand Forecasting (MinT)
& Multi-Echelon MRP.

Hierarchical Demand Forecasting & Multi-Echelon MRP reconciles SKU-store predictions with regional and national totals via MinT (Minimum Trace) and converts P50/P90 uncertainty into automated safety-stock replenishment.
Start the journey7 sections· Last modified Nov 24, 2026
FIRST PRINCIPLES. PRODUCTION SCALE.
The idea to keep with you

When concurrent writes contend on shared state, point forecasts (mean demand) cause chronic stockouts; you need MinT-reconciled P50/P90 quantile forecasts paired with lead-time variance safety stock.

TL;DR30-second simplified summary
▾

Modern MRP combines MinT-reconciled quantile forecasts with joint demand and lead-time variance safety stock.

Pooling buffers at Regional DCs cuts working capital while preserving store availability.

Full walkthrough · 7 stages
01
foundation

Why Independent SKU Forecasts Don't Add Up.

Why this matters: Understand forecast incoherence across SKU-Store, Regional DC, and National hierarchies.

At the SKU-Store level, daily sales are sparse and intermittent (0, 0, 1, 0, 2).

At the National Category level, trends and seasonality are smooth and accurate.

Hierarchy Gap

Incoherent Bottom-Up vs. Reconciled Hierarchy

National CategoryTop levelRegional DC(East/West)Middle levelSKU-Store DailyBottom level20-40% Sum MismatchPlanning failureDisaggregates

1.Intermittent Demand: Store-level zero-inflated sales make naive bottom-up sums noisy.

2.DC Alignment: Regional DCs must order the exact sum of downstream store replenishments.

Independent forecasts across retail hierarchies diverge, causing misaligned warehouse orders.

02
foundation

MinT (Minimum Trace) Optimal Reconciliation.

Why this matters: Combine information from all hierarchy levels to minimize total forecast variance.

Think of MinT (Minimum Trace) Optimal Reconciliation as the intuition layer for Hierarchical Demand Forecasting (MinT) & Multi-Echelon MRP: Combine information from all hierarchy levels to minimize total forecast variance.

Rather than forcing pure top-down or pure bottom-up overrides, MinT projects all base forecasts y_hat onto the coherent subspace using S * (S' W^-1 S)^-1 * S' W^-1 * y_hat, weighting each level inversely by its historical error covariance W.

MinT Matrix

MinT Optimal Projection Across Hierarchy

Base Forecasts(y_hat)Raw predictionsError Covariance (W)Accuracy weightsMinT ProjectionMatrixOptimal blenderCoherent ForecastsUnified planDownweights noisy levels

1.Accuracy Boost: MinT typically improves accuracy at every level—not just coherence.

2.Shrinkage W: Using Ledoit-Wolf shrinkage on W keeps matrix inversion numerically stable.

MinT reconciliation blends top, middle, and bottom forecasts weighted by historical accuracy.

Engineering Decision Framework
Problem
How to implement Hierarchical Demand Forecasting (MinT) & Multi-Echelon MRP without hitting unbounded tail latency, state divergence, or operational fragility.
Naive Solution
Use a single unpartitioned path with unbounded retries and synchronous global coordination.
Why It Fails
Global coordination serializes throughput under load, while unbounded retries amplify transient stalls into full outages.
Alternatives
Compare synchronous strict-consistency paths against bounded asynchronous replication, local caching, or partitioned ownership.
Engineering Decision
When concurrent writes contend on shared state, point forecasts (mean demand) cause chronic stockouts; you need MinT-reconciled P50/P90 quantile forecasts paired with lead-time variance safety stock.
Trade-Offs
Gains predictable p99 latency and fault isolation in exchange for explicit bounding, observability, and slightly higher implementation complexity.
Decision Exercise · Make the Call

When Hierarchical Demand Forecasting (MinT) & Multi-Echelon MRP experiences a sudden 5x traffic spike alongside a slow downstream dependency, which engineering choice best protects system stability?

03
intermediate

Probabilistic Quantiles (P10 / P50 / P90).

Why this matters: Quantify demand uncertainty for asymmetric stockout vs. overstock costs.

Think of Probabilistic Quantiles (P10 / P50 / P90) as the intuition layer for Hierarchical Demand Forecasting (MinT) & Multi-Echelon MRP: Quantify demand uncertainty for asymmetric stockout vs. overstock costs.

A point forecast of 100 units doesn't tell you whether demand could swing between 95–105 or 20–180. Quantile models (Temporal Fusion Transformer / LightGBM Quantile) output P10, P50, and P90 distributions so high-margin items can buffer at P90 while perishable goods buffer at P60.

Quantile Risk

P10 / P50 / P90 Demand Distribution

Quantile ForecasterDistribution modelP50 Median PlanLabor & capacityP90 Tail BufferService-level targetNewsvendor RatioOptimal quantileEmits 90th percentile

1.Newsvendor Critical Ratio: Optimal service quantile = margin / (margin + holding_cost).

2.Asymmetric Risk: Perishables use lower quantiles to avoid spoilage; spare parts use P95+.

Quantile forecasting replaces blind averages with calibrated risk distributions.

04
intermediate

Safety Stock & Reorder Point (ROP) Math.

Why this matters: Account for both demand variability and supplier lead-time variability.

Think of Safety Stock & Reorder Point (ROP) Math as the intuition layer for Hierarchical Demand Forecasting (MinT) & Multi-Echelon MRP: Account for both demand variability and supplier lead-time variability.

Even with perfect demand forecasts, ocean freight and supplier delays vary. Safety Stock incorporates both demand std-dev (sigma_D) and lead-time std-dev (sigma_L): SS = z * sqrt(L * sigma_D^2 + D^2 * sigma_L^2), triggering a Reorder Point when inventory position drops below expected lead-time demand + SS.

Inventory Policy

Joint Demand & Lead-Time Safety Stock

Demand Variance(sigma_D)Market riskLead-Time Variance(sigma_L)Supply riskSafety Stock BufferShock absorberReorder Point (ROP)MRP actionScales by avg demand

1.Inventory Position: Always trigger ROP on (On-Hand + On-Order - Backorders), never On-Hand alone.

2.Supplier Reliability: Unreliable suppliers with high sigma_L require dramatically higher safety stock.

Joint demand and lead-time variance formulas prevent stockouts during supplier delays.

05
intermediate

Multi-Echelon MRP & Risk Pooling.

Why this matters: Centralize safety stock at Regional DCs instead of over-buffering every store.

Think of Multi-Echelon MRP & Risk Pooling as the intuition layer for Hierarchical Demand Forecasting (MinT) & Multi-Echelon MRP: Centralize safety stock at Regional DCs instead of over-buffering every store.

Holding P90 safety stock at 2,000 individual stores ties up massive working capital. Multi-Echelon Inventory Optimization (MEIO) pools aggregate demand variance at Regional DCs (reducing total safety stock by ~sqrt(N) stores) and dispatches fast 24-hour store transfers.

Multi-Echelon MRP

Centralized DC Risk Pooling vs Store Buffers

Tier-1 SuppliersUpstream sourceRegional DC PoolVariance buffer2,000 Retail StoresLast-mile nodeMRP ExplosionEngineOrder plannerFast Transfer Orders (1d)

1.Square-Root Law: Pooling 100 stores into 1 DC cuts required safety stock by up to 90%.

2.MOQ & Pack Sizes: MRP rounds net requirements up to supplier Minimum Order Quantities.

Risk pooling at Regional DCs slashes working capital while maintaining high store availability.

06
advanced

Censored Demand (Stockout Uncensoring).

Why this matters: Prevent historical stockouts from biasing future forecasts downward.

POS sales only record what was sold, not lost demand when shelves were empty.

Training directly on raw POS sales teaches the model that demand drops to zero during stockouts—a fatal feedback loop.

Bias Correction

Stockout Censoring Detection & Latent Imputation

Raw POS SalesCensored signalEOD Inventory FlagCensor maskTobit / LatentImputerDebiasing stepClean TrainingTargetModel inputMasks out-of-stock days

1.Spiral of Death: Uncorrected stockout data causes lower forecasts -> smaller orders -> worse stockouts.

2.Intraday OOS: Even if EOD inventory is 0, check hourly POS timestamps to estimate sell-out time.

Uncensoring out-of-stock days breaks the downward spiral of under-forecasting.

07
advanced

MILP Constrained Inventory Optimization.

Why this matters: Solve warehouse space, budget, and truckload-fill constraints globally.

Think of MILP Constrained Inventory Optimization as the intuition layer for Hierarchical Demand Forecasting (MinT) & Multi-Echelon MRP: Solve warehouse space, budget, and truckload-fill constraints globally.

Independent ROP triggers can exceed DC pallet capacity or working-capital budgets during Q4 peak. A Mixed-Integer Linear Program (MILP) optimizes order quantities across all SKUs subject to warehouse cubic volume, cash budget, and full-truckload (FTL) pallet rounding.

Global Optimization

MILP Capacity, Budget & Truckload Optimizer

Reconciled P50/P90Objective weightsPhysical ConstraintsHard boundsMILP Solver(HiGHS/Gurobi)Global optimizerExecutable PO / TOFinal scheduleEnforces capacity caps

1.Truckload Consolidation: MILP tops up near-full trucks with high-velocity SKUs to cut freight cost per unit.

2.Budget Allocation: When cash or space is tight, MILP prioritizes highest margin-per-cubic-foot SKUs.

MILP optimization turns unconstrained forecasts into physically and financially feasible purchase orders.

Practice · Explain the consequences

Practice: Make the trade-off yourself.

Question 1 of 3
Score: 0/3

Why does MinT (Minimum Trace) reconciliation outperform naive bottom-up summing of store-level SKU forecasts?

Recommended Learning Flow