One Order, One Chance: The Newsvendor

Manuel D. Rossetti, PhD P.E.

Agenda

  • The one assumption we are finally removing
  • Why a single period is not a multi-period problem with \(n = 1\)
  • Demand is not sales, and why that error is invisible
  • Marginal analysis on a whiteboard, no calculus
  • The critical ratio, derived
  • Why it is the answer rather than an input to it

Every Model So Far Knew Its Demand

The EOQ and the constrained multi-item problem took a constant rate.

Dynamic lot sizing let the rate vary by period and still knew it.

Requirements planning computed it from a production plan.

From here on demand is a random variable, and the decision is made before it is observed.

We begin with the simplest such problem: the decision is made once.

The Last Order for the Belt

A distributor has stocked a mower deck belt for years. The deck it fits is now out of production.

What remains is steady replacement demand from owners of machines already in the field. The supplier is discontinuing the belt and has offered one last order.

What is stocked? One item, the belt.
Demand process? Weekly, random, no longer seasonal. About fourteen weeks remain.
When reviewed? Once. One decision, no second chance.
What triggers replenishment? Nothing. The distributor names a quantity now.
Unmet demand? Lost. The dealer gets it elsewhere.
Costs? Belt costs $50, sells for $95, scraps at $12.

Three Things Make This Different

There is no ordering cost in the model.

Exactly one order is placed whatever its size, so \(k\) is the same under every decision.

A constant added to every alternative cannot change which alternative is least.

So \(k\) drops out, and with it the entire question every deterministic model so far has been about.

Leftover Stock Has No Future Value

A single-period problem is not a multi-period problem with the number of periods set to one.

In a multi-period problem a unit left at the end is available at the start of the next, so having too many costs one period of holding.

Here it is the whole loss on the unit: $50 paid against $12 recovered.

Which is why the trade-off is overage against underage, rather than holding against ordering.

Both Errors Are Priced, and Neither Is Free

Order too many: the distributor loses $38 a belt.

Order too few: it loses the $45 margin on each belt it could have sold.

Both are opportunity costs, measured against the decision that could have been made.

And neither appears in any ledger.

Demand Is Not Sales

One distinction before any data are used. It is the commonest error in this material, and it is invisible in the answer.

  • Demand is what customers would have bought.
  • Sales is what they did buy.

The two differ whenever the shelf was empty.

A week that sold 40 belts because 40 were on the shelf, and a week that sold 40 because 40 were wanted, look identical in a sales record.

What Censoring Does to You

Sales are demand censored at whatever was available.

So a history of sales understates both the average and the spread.

And it understates them most in exactly the weeks when the item mattered, because those are the weeks it ran out.

An organization that wants to model demand has to record the demand it could not fill, and most do not.

Where that record does not exist, every quantity computed from the fit is too small. Say so when you report the answer.

Now Make the Decision, With Arithmetic

No calculus. No fitted distribution. A planner at a whiteboard.

Asked for a judgment, the distributor offers five outcomes for total remaining demand:

Demand \(x\), belts 300 400 500 600 700
\(P\{X = x\}\) 0.15 0.25 0.30 0.20 0.10
\(P\{X \le x\}\) 0.15 0.40 0.70 0.90 1.00

The mean is 485 belts.

The sketch is coarse on purpose: what follows needs the shape of demand, not its detail.

Ask a Smaller Question

Rather than evaluate every candidate, ask:

Given that we have decided on some quantity, is one more hundred belts worth buying?

It pays off when demand exceeds what we already have: probability \(P\{X \ge Q+100\}\), each belt earning the $45 margin.

It costs when demand stops at or below what we have: probability \(P\{X \le Q\}\), each unsold belt losing $38.

\[ 45 \times 100 \times P\{X \ge Q+100\} \;>\; 38 \times 100 \times P\{X \le Q\} \]

Step 1, From 300 to 400

Demand reaches 400 or more with probability 0.85.

Gain: \(45(100)(0.85) = \$3{,}825\).

Demand stops at 300 with probability 0.15.

Loss: \(38(100)(0.15) = \$570\).

The step is worth +$3,255. Take it.

Step 2, From 400 to 500

Demand reaches 500 or more with probability 0.60.

Gain: \(45(100)(0.60) = \$2{,}700\).

Demand stops at 400 or below with probability 0.40.

Loss: \(38(100)(0.40) = \$1{,}520\).

The step is worth +$1,180. Take it.

Step 3, From 500 to 600

Demand reaches 600 or more with probability 0.30. Gain: $1,350.

Demand stops at 500 or below with probability 0.70. Loss: $2,660.

The step loses $1,310. Stop.

The Whole Analysis

From To \(P\{X \ge \text{to}\}\) Gain \(P\{X \le \text{from}\}\) Loss Net
300 400 0.85 $3,825 0.15 $570 +$3,255
400 500 0.60 $2,700 0.40 $1,520 +$1,180
500 600 0.30 $1,350 0.70 $2,660 -$1,310
600 700 0.10 $450 0.90 $3,420 -$2,970

Order 500 belts.

Notice that 500 is more than the mean of 485.

The distributor should plan to be left with belts more often than it plans to run out, because running out costs more per belt than scrapping does.

Why the Sign Changes Only Once

That is not luck. Rearrange the marginal test: the step is worth taking while

\[ P\{X \le Q\} < \frac{45}{45+38} = \frac{c_{u}}{c_{u}+c_{o}} = 0.5422 \]

The left side is a cumulative distribution function, which never decreases.

So once the test fails, it fails for every larger quantity.

Stopping at the first negative step is correct, not merely convenient.

The rule: order the smallest quantity whose cumulative probability reaches 0.5422. \(F(400) = 0.40\) is short; \(F(500) = 0.70\) clears it.

The Check

Costing all five candidates directly should agree, and it does.

\(Q\) 300 400 500 600 700
Expected profit $13,500 $16,755 $17,935 $16,625 $13,655

Three routes, one answer.

Worth performing the first time you use marginal analysis on a new problem.

The marginal argument is only valid when expected profit has a single peak, and the direct calculation is what confirms it.

What the Hand Method Cost, and What It Cannot Do

Five outcomes, four steps, no distribution and no calculus.

What it cannot do is say anything between 400 and 500 belts.

And the real decision is a number of belts, not a number of hundreds.

For that we need a distribution. First, let us state the model properly.

The Newsvendor Model

It carries the name of a vendor buying newspapers for the day, and it applies to any resource committed before the need for it is known.

  • Let \(X\) represent demand over the period, with \(F(x) = P\{X \le x\}\).
  • Let \(Q\) represent the quantity ordered, the decision.
  • Let \(c_{o}\) represent the overage cost, the loss on each unit left over.
  • Let \(c_{u}\) represent the underage cost, the loss on each unit of demand not met.

Both are opportunity costs, and both are strictly positive.

One Expression for Both Cases

At the end of the period exactly one of two things has happened: \(Q - X\) units are left, or \(X - Q\) units of demand went unmet.

With \((y)^{+} = \max(y, 0)\):

\[ C(Q, X) = c_{o}(Q-X)^{+} + c_{u}(X-Q)^{+} \]

Exactly one of the two terms is non-zero for any realized demand.

It is a random variable, because \(X\) is, and the decision minimizes \(E[C(Q,X)]\).

The Same Model, as a Profit

Practice writes this in quantities that appear on an invoice.

Let \(c\) be the purchase cost, \(s\) the selling price, \(u\) the salvage value, with \(s > c > u\). The vendor sells \(\min(X,Q)\), salvages \((Q-X)^{+}\), and pays for \(Q\):

\[ G(Q, X) = s\min(X, Q) + u(Q-X)^{+} - cQ \]

Matching terms,

\[ c_{o} = c - u, \qquad c_{u} = s - c \]

Overage is what a unit loses between the counter and the scrap yard. Underage is the margin forgone. For the belt: $38 and $45.

Why the Two Agree

They differ by \((s-c)E[X]\), the profit if every unit demanded were sold.

That quantity does not depend on \(Q\). It shifts the objective without moving its optimum:

\[ E[G(Q,X)] = (s-c)E[X] - E[C(Q,X)] \]

Use whichever formulation the audience speaks.

Derive in costs, because the expression is shorter. Report in profits, because that is what the distributor will ask for.

Taking the Expectation

Recall the first order loss function \(G^{1}(b) = E[(X-b)^{+}]\), the expected amount by which demand exceeds \(b\).

The shortage term is \(G^{1}(Q)\) by definition.

The leftover term needs one step. Notice the identity

\[ (Q-X)^{+} = (X-Q)^{+} + Q - X \]

When \(X < Q\) the right side is \(0 + Q - X\). When \(X \ge Q\) it is \(X - Q + Q - X = 0\).

The Whole Model in One Line

Taking expectations of that identity,

\[ E\left[(Q-X)^{+}\right] = G^{1}(Q) + Q - E[X] \]

The expected leftover is the expected shortage plus however far the order sits above the mean. Putting the two together,

\[ E[C(Q)] = (c_{u}+c_{o})G^{1}(Q) + c_{o}\left(Q - E[X]\right) \]

The first term is the cost of being short, weighted by both prices, because a unit short is both a sale lost and a unit not held.

The second is the cost of the position itself.

Differentiating

Using \(dG^{1}(Q)/dQ = -G^{0}(Q)\), where \(G^{0}(Q) = 1 - F(Q)\):

\[ \frac{d}{dQ}E[C(Q)] = -(c_{u}+c_{o})G^{0}(Q) + c_{o} \]

Setting it to zero gives \(G^{0}(Q) = c_{o}/(c_{u}+c_{o})\), and since \(G^{0} = 1-F\):

\[ F(Q^{*}) = \frac{c_{u}}{c_{u}+c_{o}}, \qquad Q^{*} = F^{-1}\!\left(\frac{c_{u}}{c_{u}+c_{o}}\right) \]

It is a minimum: the second derivative is \((c_{u}+c_{o})f(Q)\), non-negative everywhere, so the expected cost is convex and the stationary point is the bottom.

That Is the Whiteboard Rule

\(c_{u}/(c_{u}+c_{o})\) is the critical ratio.

It is exactly the rule the marginal analysis produced by hand.

And the derivation is why that rule was right.

Reading It

The left side is \(P\{X \le Q^{*}\}\): the probability that demand falls short of the order.

That is the probability of having too much.

So the critical ratio is not an input to the answer.

It is the answer, expressed as a service level the costs imply.

It Reads as Odds

The ratio depends only on the relative size of the two costs.

Being short costs 3 times as much 4 times 9 times
Optimal chance of leftovers 75% 80% 90%

Two consequences follow, and both contradict what an organization usually rewards.

Never Having Leftovers Is Bad

A buyer who ends every period with nothing left is not being careful.

They are ordering at a critical ratio near zero, which is only correct when a lost sale costs nothing.

For the belt the ratio is 0.5422, so the distributor should expect leftovers in about 54% of futures.

A manager who treats scrapped belts as evidence of a mistake will push the buyer below the optimum.

And the loss will never appear in any account, because it is a sale that did not happen.

Never Having Unsatisfied Customers Is Also Bad

The mirror error costs just as much.

At the belt’s ratio the distributor should expect to run out about 46% of the time.

A service target of 99% is a claim that \(c_{u}\) is ninety-nine times \(c_{o}\).

If that is not true, the stock is too large.

So the useful question to ask of a stated service level is not whether it is high enough. It is what ratio of costs would make it optimal, and whether anyone believes those costs.

What We Did Today

Demand is now random, and the decision precedes the observation.

A single period is not a multi-period problem with \(n = 1\). The ordering cost drops out and leftover stock loses its whole value.

Sales are censored demand, and a fit to sales is biased low exactly where it matters.

Marginal analysis gives the rule on a whiteboard, and the derivative confirms it.

The critical ratio is a service level the costs imply, not a target you choose.

For Next Time

Read before next session: Getting a Demand Distribution, Intermittent and Slow-Moving Demand, and Continuous Demand.

Next session turns the ratio into a number of belts:

  • Fitting a distribution to 104 weeks, and what the variance to mean ratio decides before any test runs
  • Why a goodness of fit test confirms the choice rather than making it
  • What to do when a history is mostly zeros
  • Why the normal was wrong weekly and safe over fourteen weeks
  • Why the optimum is flat, and what the choice of family costs

We have the rule. What we do not yet have is a distribution to apply it to, and that turns out to carry more of the answer than the rule does.

⌂ Index