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:

413.1.1. Assumptions

413.1.2. Setup

Define:

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:

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:

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