Here are two products with exactly the same forecast: an average of 100 units, give or take about 40. One should be ordered at 177 units. The other should be ordered at 72.
Nothing about the forecast explains that gap. The economics do. One product loses $60 of margin every time it is out of stock and costs $3 to carry until the next delivery. The other earns $1.50 per sale and is thrown away at a $4.50 loss if it does not sell.
Exhibit 1
Same forecast, opposite decisions
SKU A · Engine sensor
$60 margin lost per missed sale; costs $3 to carry a spare to the next delivery.
SKU B · Fresh salad kit
$1.50 margin per sale; every unsold kit is thrown away at a $4.50 loss.
Most planning systems would give these two products the same treatment: forecast 100, add a safety buffer, call it a few weeks of cover. This guide is about why that is wrong, what to do instead, and how four ideas fit together: probabilistic forecasts, the critical ratio, the economic order quantity, and the planning horizon.
The forecast you actually have is a distribution
A point forecast says “100.” What the forecaster actually knows is closer to “probably between 60 and 150, most likely around 90, with a long tail on the high side.” That second statement is a probabilistic forecast: a full distribution of what demand might be, not just its center.
The distinction matters because an order quantity is not a guess about demand. It is a decision about which part of the distribution to cover. Ordering the mean covers roughly half of it. Ordering the 95th percentile covers almost all of it, at the cost of carrying stock that usually will not sell. Which part is right depends on what each mistake costs, and you cannot even ask that question with a single number.
A point forecast throws away exactly the information the order decision needs: how wide the uncertainty is, and in which direction it leans.
The critical ratio: price the two ways to be wrong
Every order can be wrong in two directions.
- Too few. A customer wants the item and it is not there. The cost is the margin you did not earn, plus any penalty, expediting, or lost goodwill. Call it , the underage cost per unit.
- Too many. A unit is left over. The cost is what you lose on it: the purchase price minus any salvage for a perishable item, or the cost of carrying it until it can be sold for a durable one. Call it , the overage cost per unit.
Now think about the order one unit at a time. Should you add the next unit? With probability demand reaches that unit, and stocking it earns that you would otherwise have lost. With probability it is left over and costs . Add the unit while the expected gain beats the expected loss:
Stop where the two balance. Rearranged, the optimal order satisfies
That fraction is the critical ratio. It tells you which percentile of the demand distribution to stock to. A critical ratio of 0.95 means “order the 95th percentile of demand.” A ratio of 0.25 means “order the 25th percentile.”
Drag the costs below and watch where the stopping point lands. The curve is the probability that the next unit sells; the dashed line is the break-even probability . Every unit to the left of the crossing is worth stocking. Every unit to the right is not.
Exhibit 2 · Interactive
Keep adding units while the next one is likely enough to sell
Two consequences are worth stating plainly.
- Only the ratio matters, not the size of the costs. Costs of $12 and $4 give exactly the same order as $3 and $1. What decides the quantity is how much worse one mistake is than the other.
- The service level is an output, not an input. The probability of not stocking out at is exactly the critical ratio. A 95% in-stock target is therefore the right answer only for items whose shortage costs nineteen times their overage. Applied uniformly, it over-stocks some items and under-stocks others.
What goes into each cost
The costs depend on whether leftover stock is lost or carried forward.
| Situation | Underage cost | Overage cost |
|---|---|---|
| One-shot, perishable (newspapers, fresh food, seasonal goods) | price − cost, plus any goodwill or penalty | cost − salvage value |
| Repeating, leftover carries to the next cycle | lost margin, or backorder penalty | holding cost until the unit can be used |
| Critical part where a stockout stops an operation | value of the downtime avoided | holding and obsolescence of one more spare |
The middle row is the one most planners get wrong. When unsold stock simply waits for next week, its overage cost is not its purchase price. It is the cost of holding it a little longer: capital, space, handling, and the risk it becomes obsolete. That is usually small, which is why durable, high-margin items deserve high critical ratios.
Why the model sometimes orders less than you expect to sell
This is the result that surprises people most, and it is the one that saves the most money.
Look at the salad kit again. Its forecast mean is 100 and the model orders 72, fewer than it expects to sell. Planners often read that as the model being timid or the forecast being too low. It is neither.
Take the 91st unit. The forecast says it has a 52% chance of selling, so it is more likely to sell than not. If it sells, it earns $1.50. If it does not, it costs $4.50 in the bin. Its expected value is
A unit that will probably sell can still be a bad bet. The model is not ignoring demand; it is declining to pay a near-certain cost against an uncertain sale. When the overage cost is larger than the underage cost, the critical ratio falls below one half and the optimal order sits below the median of demand.
The mirror image is just as important. For the engine sensor, a missed sale costs $60 and an extra unit costs $3 to carry. Unit 150 has only about an 11% chance of selling, and it is still worth stocking. Expected margin beats expected holding cost:
More uncertainty does not always mean more stock
The usual instinct is that noisier demand needs more safety stock. That is true only when the critical ratio is above one half. Below one half, more uncertainty means less stock: the downside of over-ordering grows faster than the upside.
Exhibit 3
Uncertainty pushes stock apart: up for high-ratio items, down for low-ratio items
With the same forecast mean, widening the uncertainty from a standard deviation of 20 to 60 moves the engine sensor’s order from 136 to 216 units and the salad kit’s from 86 down to 59. The same forecast error is a reason to buy more of one product and less of another. Any rule that responds to variability in only one direction, such as “add two standard deviations of safety stock,” is wrong for half of the catalog.
Economic order quantity: how much per order
The critical ratio answers “how much protection.” A second question comes first in any repeating operation: how much to buy each time you order.
If ordering is expensive (freight minimums, setup time, purchase-order overhead), you want to order rarely, in large batches. If holding is expensive, you want to order often, in small ones. The economic order quantity balances the two. With annual demand , a fixed cost per order, and a holding cost per unit per year,
Exhibit 4 · Interactive
EOQ sets how much per order, and with it how often you order
Inventory over a quarter
Annual cost against order size
At the optimum, the annual cost of ordering equals the annual cost of holding, and the total cost curve is remarkably flat near the bottom: ordering 20% more or less than the EOQ raises cost by at most 2.5%. That flatness is useful. It means you can round to pack sizes or align with a delivery schedule at almost no cost.
EOQ does something less obvious, too. It sets how often you order: every years, or about 5 weeks in the default example above. That cycle is the review period, and it feeds directly into the next idea.
EOQ alone assumes demand is known. The critical ratio alone assumes you order once. Real inventory policies combine them: EOQ economics set the order size and cadence, and the critical ratio sets how much protection to carry against what demand might do in the meantime.
The planning horizon: what each order has to cover
When you place an order, it has to protect you until the next order arrives. That window is the protection interval:
Lead time is mostly set by the supplier; the review period, how often you order, is a choice with its own economics. The companion piece, How long does inventory need to last?, shows the window on a timeline and how to choose the review period for each SKU.
Over that interval, demand accumulates. If weekly demand has mean and standard deviation , and weeks are roughly independent, demand over weeks has mean and standard deviation . Uncertainty grows with the square root of the horizon, not in proportion to it.
The economically optimal order-up-to level is the critical-ratio percentile of demand over that interval:
where is the shortage cost and the holding cost per unit over a cycle. In a repeating business this is the same critical ratio as before, applied to a different distribution: demand over the horizon rather than demand in one period.
Why weeks of cover is the wrong question
Many planning teams set targets as weeks of cover: “hold six weeks of average demand.” Divide the economic target by average weekly demand and you get the cover the economics actually imply:
This is the key equation of this guide. It says the right number of weeks depends on three things a cover rule ignores:
- The economics, through . Above a critical ratio of 0.5, is positive and you hold more than the horizon. Below 0.5, is negative and you hold less than the demand you expect within the horizon.
- The variability, through CV. Two SKUs with the same economics but different volatility need different cover.
- The horizon, through . The extra cover grows with the square root of the horizon. At a critical ratio of 0.9 and a CV of 0.4, a 1-week horizon needs 0.5 extra weeks of stock, a 4-week horizon needs 1.0, and a 9-week horizon needs 1.5. Longer horizons need more stock in total but less protection per week. And when the economics themselves depend on the horizon, as they do for anything that ages on the shelf, even the direction of the adjustment can change. The next section shows how.
So a planning horizon is a period of time the order must cover, set by lead time and the ordering cadence that EOQ economics imply. Weeks of cover is a quantity of stock, expressed in units of average demand. Treating one as the other quietly assumes every SKU has a critical ratio of exactly one half, or no variability at all.
Try it. Pick an SKU type and compare the economic target with a cover rule.
Exhibit 5 · Interactive
A planning horizon is not weeks of cover
Change the horizon and the economics change too
A common shortcut treats weeks of cover as the planning horizon plus a fixed margin: plan for four weeks, hold five; plan for eight weeks, hold ten. It feels proportionate. It is not what the economics say, for two separate reasons.
First, protection does not scale with time. Expected demand over the horizon grows in proportion to , but its uncertainty grows only with , because good and bad weeks partly cancel. So even when an SKU’s critical ratio stays fixed, the buffer beyond the horizon grows more slowly than the horizon does. A critical spare part (critical ratio about 0.99, CV 0.6) needs 2.4 weeks of cover for a 1-week horizon, which is 2.4 times the horizon. For a 12-week horizon it needs 16.2 weeks, only 1.35 times the horizon. A steady staple goes from 1.33 times to 1.06 times. A rule that adds a fixed percentage to the horizon over-protects every one of these SKUs on long horizons.
Second, the cost of a leftover depends on how long it has to wait. A unit that does not sell within the horizon has been sitting on the shelf for the whole horizon. For anything that ages, such as fashion that gets marked down, food that approaches its date, electronics that go obsolete, or simply stock that ties up expensive capital, that unit costs more the longer the horizon is. Write the ageing cost as per week waited and the critical ratio becomes a function of the horizon:
This is a stylized model, but the direction is general: a longer horizon makes every leftover more expensive, so the economics ask for a lower percentile of a wider distribution. Two forces now pull against each other. The horizon adds expected demand, which raises the order. The falling ratio pulls the target down the distribution, which lowers it relative to that demand.
Take an SKU that earns $8 per sale, loses $1 on a leftover, and loses another $1.50 for every week a leftover waits. On a 1-week horizon its critical ratio is 0.76 and it deserves extra protection: 1.36 weeks of cover. On a 4-week horizon the ratio has fallen to 0.53 and cover is almost exactly the horizon. On a 12-week horizon the ratio is 0.30, and the economics call for 11.1 weeks of cover, less than the demand it expects to see. The SKU did not change. The forecast did not change. Only the horizon changed, and the right answer flipped from “hold more than you expect to sell” to “hold less.”
Exhibit 6 · Interactive
Lengthen the horizon and the right cover can rise faster, slower, or not at all
The same logic runs in reverse, and that is where it pays. Shortening the horizon, through shorter lead times or more frequent deliveries, does not just shrink stock in proportion. For an ageing SKU it raises the critical ratio, which justifies more protection per week of horizon on a much smaller base. Total stock falls and availability rises at the same time. That is why the length of the horizon is itself an economic decision, traded off against ordering costs through EOQ, rather than a fixed calendar fact that cover should simply be scaled to.
The practical conclusion is uncomfortable for any rulebook. There is no multiplier that converts a horizon into a cover target, because the multiplier depends on the SKU’s margin, its leftover cost, how fast it ages, and how noisy its demand is, and it moves when the horizon moves. The only consistent way to set cover is to compute it.
Across a whole catalog, the economically right cover forms a landscape, not a constant. For a four-week protection interval, critical spares want over six weeks of stock and short-life, thin-margin items want under three. A six-week rule matches the economics only along a thin curve; everywhere else it holds stock the business cannot justify, or gives away margin it should have protected.
Exhibit 7
The right weeks of cover depends on the SKU's economics and its variability
Which SKUs should hold more, and which should hold less
Putting it together:
| SKU profile | Critical ratio | What the economics do | Why |
|---|---|---|---|
| Critical spare, cheap to hold | very high | hold far above expected demand, more as volatility rises | a stockout costs far more than a spare |
| High-margin staple | high | hold modestly above the horizon | shortages cost margin, leftovers wait cheaply for next week |
| Balanced | about 0.5 | hold about the median of horizon demand | the two mistakes cost about the same |
| Volatile, low margin | low | hold below expected demand, less as volatility rises | each extra unit is a poor bet on an uncertain sale |
| Short-life or perishable | very low | hold well below expected demand | leftover stock is a total loss |
The model’s lower quantity for the bottom two rows is not a forecast problem and not a reason to override it. It is the model declining to pay holding and waste costs against demand that probably will not show up. Overriding it “to be safe” makes the business less safe: it converts margin into stock that is more likely to be written off than sold.
In Python
The calculation is short once the forecast is a distribution. A common, robust approach is to simulate demand over the protection interval and take the critical-ratio quantile, which works for any forecast you can sample from.
import numpy as np
rng = np.random.default_rng(7)
def order_up_to(weekly_samples, horizon_weeks, cu, co, n_sims=50_000):
"""Critical-ratio quantile of demand over the protection interval.
weekly_samples: array of shape (n, horizon_weeks) of simulated weekly
demand from a probabilistic forecast, or any generator of such paths.
"""
cr = cu / (cu + co)
horizon_demand = weekly_samples[:n_sims, :horizon_weeks].sum(axis=1)
return np.quantile(horizon_demand, cr), cr
# Example: lognormal weekly demand, mean 100, standard deviation 40.
mean, sd, weeks = 100.0, 40.0, 4
s2 = np.log(1 + (sd / mean) ** 2)
paths = rng.lognormal(np.log(mean) - s2 / 2, np.sqrt(s2), size=(50_000, weeks))
for name, cu, co in [("engine sensor", 60.0, 3.0), ("salad kit", 1.5, 4.5)]:
s, cr = order_up_to(paths, weeks, cu, co)
print(f"{name:14s} CR={cr:.2f} S*={s:,.0f} cover={s / mean:.1f} weeks")
# Economic order quantity
def eoq(annual_demand, cost_per_order, holding_per_unit_year):
return np.sqrt(2 * annual_demand * cost_per_order / holding_per_unit_year)
print(f"EOQ: {eoq(5_200, 150, 6):,.0f} units per order")
# When stock ages, the ratio depends on the horizon: CR(H) = cu / (cu + co + a H).
from statistics import NormalDist
cu, co, a, cv = 8.0, 1.0, 1.5, 0.5
for H in (1, 4, 12):
cr = cu / (cu + co + a * H)
cover = H + NormalDist().inv_cdf(cr) * cv * H ** 0.5
print(f"H={H:2d} weeks CR={cr:.2f} cover={cover:.1f} weeks")
# H= 1 weeks CR=0.76 cover=1.4 weeks
# H= 4 weeks CR=0.53 cover=4.1 weeks
# H=12 weeks CR=0.30 cover=11.1 weeks
Sampling makes it easy to use whatever the forecast actually says, including skew, intermittency, or correlation between weeks, rather than forcing it into a normal shape.
Common mistakes
- Treating the forecast as the order. The forecast is a distribution; the order is a decision about which part of it to cover.
- One service level for every SKU. A uniform target is right only for the SKUs whose cost ratio happens to match it.
- Using purchase price as the overage cost for durable stock. If leftovers carry forward, the overage cost is holding cost, which is usually far smaller.
- Adding safety stock in one direction only. For low critical ratios, more uncertainty should mean less stock.
- Setting targets in weeks of cover. Cover is an output of the economics, the variability, and the horizon, not a policy input.
- Scaling cover in proportion to the horizon. Protection grows with , and for stock that ages the critical ratio falls as the horizon lengthens. A longer horizon can justify less cover per week, or even less than expected demand.
- Overriding low quantities “to be safe.” For low-ratio items, extra stock is the risky choice.
Where to go next
- Where should the next dollar of inventory go? allocates a limited budget across SKUs by expected return per dollar.
- How long does inventory need to last? explains the protection interval and how to choose the review period.
- Set your own costs and distributions in the Critical Ratio Explorer.
- The economic order quantity note covers the classic model and its assumptions.
- Every assumption above (independent weeks, normal approximation for the cover formula, linear costs) can be relaxed. Correlated demand widens the horizon distribution faster than ; fixed costs and minimum order quantities change the policy shape. Those are the next patterns in the inventory section of the library.