Here are two order quantities for the same SKU, evaluated against the same demand distribution.
| Order quantity | MAE | MSE | Expected cost |
|---|---|---|---|
| 80 units | 16 | 480 | $400 |
| 100 units | 24 | 880 | $300 |
The first is better by mean absolute error. It is also better by mean squared error. It happens to be the mean of the demand distribution, and its median, and its mode. By every accuracy metric on the dashboard, 80 is the right answer.
It costs 33% more than ordering 100.
This is not a rounding artifact or a selectively chosen distribution. It is the normal case, and it follows from something we argued qualitatively in Beyond Accuracy: What Makes a Good Forecast?: a good forecast has to support a real decision. This post makes that concrete with a loss function.
The mean answers a question nobody asked
Train with squared error and you recover the conditional mean. Train with absolute error and you recover the conditional median. Both answer the same question: what is demand likely to be?
Nobody acts on demand. They act on an order quantity, a headcount, a provisioned instance count, a cash load. And the cost of being wrong is almost never symmetric.
Take a jacket that costs wholesale, sells for , and clears at at the end of the season. Every unit of demand you failed to stock costs you the margin you didn't earn. Every unit you overstocked costs you the you lost clearing it.
Underage hurts four times as much as overage. Ordering to the mean treats those two as if they were the same thing, which is a decision about how often you are willing to run out. On this jacket the defensible stockout rate is one season in five. Ordering to the middle of the distribution accepts something much closer to one in two on a product where running out costs 4× a markdown. Nobody in the room chose that. It fell out of the metric.
That one in five rate isn't a guess. The fraction , here , or , is called the critical ratio, written . It is the answer to the classic newsvendor problem: stock the percentile of demand and you have priced the two mistakes against each other correctly. For this jacket that means ordering the 80th percentile, which is the same thing as accepting a stockout one season in five. Order the average instead and you have chosen a different number, without choosing it.
One caveat on scope, because it decides how you use everything below. The critical ratio is the answer to the newsvendor problem, which is a single ordering decision. In the original version a seller decides the night before how many newspapers to buy for the next day, the papers arrive in the morning and sell through the day, and whatever is left is discounted at the close because it is worthless tomorrow. The jacket fits the same shape: you commit to a quantity at the start of the season, sell through the season, and clear the remainder at near the end. One commitment, one demand realization, one salvage event, no chance to top up in between. Where you can reorder mid stream, the right model is a multi period inventory policy rather than a single quantile, and the critical ratio is only the first term of the answer.
Why safety stock formulas quietly fail
Most planners already know the mean isn't the order quantity. The standard patch is a safety stock buffer:
where is the number of standard deviations matching the service level you're targeting, the standard deviation of demand in one period, and the lead time counted in those same periods.
This is the right instinct with the wrong machinery. That formula assumes forecast errors are Gaussian, symmetric, and homoscedastic, with the same spread this week as next and the same shape for a fast mover as for a slow one. Real demand is skewed, intermittent, and heteroscedastic. Promotions fatten one tail and not the other.
The failure is worse than "slightly off," because the approximation degrades exactly where you're asking it to work. A critical ratio of 0.8 or 0.95 is a question about the upper tail, and the tail is where a Gaussian fitted to mostly central data is least trustworthy. You are extrapolating a symmetric bell into a region the data said was lopsided. The formula returns a confident number and the number is wrong in the direction that costs the most.
A quantile from a predictive distribution doesn't need any of those assumptions. You asked for the 80th percentile and you get the 80th percentile.
A worked example you can check by hand
Let demand take five values:
| Demand | 40 | 60 | 80 | 100 | 120 |
|---|---|---|---|---|---|
| Probability | 0.10 | 0.20 | 0.40 | 0.20 | 0.10 |
This distribution is deliberately symmetric. Its mean, median, and mode are all 80, so nothing here depends on skewed demand. With and , we add one extra column: pinball loss, the standard score for a quantile forecast. It is a price list for mistakes: at quantile you pay for every unit you fall short and for every unit you overshoot. At that is 0.80 per unit short against 0.20 per unit over, so underestimating is penalized four times as hard as overestimating, and 4 is exactly . Ordering 100 against demand of 60 costs ; against demand of 120 it costs . Weight the five outcomes by their probabilities and you get the 6.0 in the table below.
| Order | MAE | Expected cost | Pinball at |
|---|---|---|---|
| 60 | 24 | $900 | 18.0 |
| 80 | 16 | $400 | 8.0 |
| 90 | 20 | $350 | 7.0 |
| 100 | 24 | $300 | 6.0 |
| 110 | 32 | $350 | 7.0 |
| 120 | 40 | $400 | 8.0 |
Two things to notice.
The optimum is 100, the 0.8 quantile, exactly as the critical ratio predicted. Now multiply any pinball figure by : , and the same works on every row. That is not a coincidence. Pinball loss weights the two error directions by and the complement of . At the critical ratio, those weights are exactly and divided by their sum. Undo the division and you are back to money, to the cent. Pinball loss at the critical ratio is not a proxy for business cost. Up to a constant it is business cost, and MAE is the special case , which assumes stockouts and markdowns hurt equally. No retailer believes that.
Then look at ordering 60 versus ordering 100. Identical MAE of 24. Costs of and . MAE cannot see a 3× difference in money, because MAE was never measuring money. Pinball loss at 0.8 separates them 18.0 to 6.0, precisely 3:1.
As the critical ratio climbs, the penalty for ordering to the mean compounds:
| Optimal order | Cost at optimum | Cost ordering to the mean | |||
|---|---|---|---|---|---|
| 10 | 10 | 0.500 | 80 | $160 | $160 |
| 30 | 10 | 0.750 | 100 | $280 | $320 |
| 40 | 10 | 0.800 | 100 | $300 | $400 |
| 60 | 10 | 0.857 | 100 | $340 | $560 |
| 90 | 10 | 0.900 | 100 | $400 | $800 |
| 190 | 10 | 0.950 | 120 | $400 | $1,600 |
At the mean is exactly right. That is the only row where it is, and it describes a business where running out and marking down are equally painful.
