413. Overview
413.1. Newsvendor
Single-period inventory under uncertain demand: order before seeing demand. After demand realizes, leftover stock is salvaged at , and unmet demand is lost.
The trade-off:
- Order too much → leftovers, lose per unsold unit.
- Order too little → stockouts, lose per missed sale.
413.1.1. Assumptions
- Single period (no carryover to next period)
- Single product
- Demand is random with known distribution
- Lead time is zero — receive order before demand realizes
- Linear underage and overage costs
413.1.2. Setup
- = sale price per unit
- = purchase cost per unit
- = salvage value per unsold unit (with )
- = random demand, with CDF and density
- = order quantity (decision variable)
Define:
- Underage cost (lost margin per missed sale):
- Overage cost (loss per unsold unit):
413.1.3. Derive via marginal analysis
Imagine we’ve decided to order units. Should we order one more?
The -th unit either sells or doesn’t:
- It sells if demand exceeds , with probability . Profit: per unit (margin we’d otherwise lose).
- It doesn’t sell if demand , with probability . Cost: per unit (overage).
Expected marginal profit of ordering one more unit:
Order more units while , stop when :
This ratio is the critical ratio (CR). Read it as: “What probability of not stocking out balances the two costs?”
413.1.4. Inverting to get
For any demand distribution, the recipe is the same: compute CR, look up the quantile.
413.1.5. Normal demand specialization
If , write where is the standard-normal quantile of CR.
Common values:
- → (order the median)
- →
- →
- →
- →
When (stockouts much worse than leftovers), CR and pushes you to over-stock. Conversely when , CR and (under-stock the median).
Example
Given (newsstand selling newspapers):
- Sale price: = $3 / unit
- Purchase cost: = $1 / unit
- Salvage value: = $0 / unit (unsold papers worthless)
- Demand:
Step 1 — underage and overage
Step 2 — critical ratio
Each unit ordered should have a chance of selling — overstocking is twice as cheap as stocking out.
Step 3 — quantile lookup
For normal demand, :
Step 4 — interpret
At : about a chance of selling out (matching CR), chance of leftovers. Sensible because the underage cost () is twice the overage cost () — the optimum biases toward stocking more than the mean (100).
newsvendor.py
import scipy.stats as stats
P, C, S = 3, 1, 0 # sale price, purchase cost, salvage value
mu, sigma = 100, 20 # demand mean and standard deviation
C_u = P - C # underage cost
C_o = C - S # overage cost
CR = C_u / (C_u + C_o) # critical ratio
z_star = stats.norm.ppf(CR) # quantile
Q_star = mu + z_star * sigma