Skip to content
Inan Jaggi

All projects

2026 · Forecasting and optimization · supply chain

Spares Forecast & Replenishment

  • Forecasting
  • Optimization
  • Supply chain

A weekly planning pipeline for a fictional manufacturer's spare parts across three distribution centers. It forecasts demand for each part at each DC, turns forecast error into safety stock, and builds the replenishment plan with one optimization model, then replays 13 held-out weeks against the planners' hand rule.

13 held-out weeks
  1. −22%forecast error vs seasonal naive
  2. −40%average inventory vs hand rule
  3. 95.1%fill rate (hand rule: 97.9%)
  4. 0budget or dock breaches (hand rule: 7)
My role
Solo build
Team
Fictional customer, synthetic data
Result
40% less inventory than the planners' hand rule, at a 95% fill rate (simulated)
Status
Public · 6 tests passing
Tools and methods
Python, statsforecast, OR-Tools CP-SAT, pandas, matplotlib, pytest

The problem

Spare parts ship from three DCs. Fast movers stock out, slow movers pile up, and planners reorder by hand with the same rule for everything: reorder at 4 weeks of demand, fill up to 10.

How it works

  • Each series is classed as smooth or intermittent and gets candidate models (AutoETS, Croston, ADIDA, IMAPA, seasonal naive). statsforecast's cross-validation picks the best one per series.
  • Safety stock comes from backtest error over the lead time plus one review week, at a 95% service target.
  • One CP-SAT model plans the next four order weeks for all DCs. It minimizes holding, ordering, freight and lost-sales cost under minimum order quantities, pallet rounding, dock capacity and a $250,000 weekly budget.

Results

  • Forecast error (WAPE) of 0.368 on weeks the model never saw, against 0.472 for seasonal naive: 22% lower.
  • In the 13-week replay, 40% less average inventory ($528K against $886K) and no budget or dock breaches, where the hand rule had 7.
  • The trade-off: fill rate is 2.8 points lower than the hand rule, and total cost is higher under my shortage penalty. Against the hand rule set to a similar inventory level, it wins on both fill rate and inventory.

What I don't claim

  • The data is synthetic, and the costs, penalties and budget are my assumptions.
  • The weekly re-plans stop at a 3-second limit and are far from proven optimal, so the replay likely understates the model.