Inventory Theory · Normal Loss Function

Normal Loss Function Visualizer

See how reorder point changes stockout probability, expected shortage, and inventory cost.

P(stockout) = shaded right tail NL(z) = average overshoot (standardized) — not the tail area nR = σ × NL(z) = units short Safety stock = R − mean LT demand

Lead-Time Demand Distribution

The red shaded right tail shows the probability of stockout. The normal loss function NL(z) is not this area — it measures the average amount by which demand exceeds R, weighted across all right-tail outcomes.

Mean lead-time demand Reorder point / safety stock Stockout probability (right tail)

Computed Outputs

Reading order: safety stock positions R → tail area = P(stockout) → NL(z) = avg standardized overshoot → nR = σ × NL(z) = actual units short per cycle.

Conceptual Centerpiece
What Is the Normal Loss Function?

Understanding overshoot — the inventory shortfall that occurs when demand exceeds the reorder point R.

ƒ
NL(z) is not the probability of a stockout. It captures both how often demand exceeds R and how far it exceeds R. The expected shortage nR = σ × NL(z) converts that overshoot into actual units.
Three Possible Outcomes

Shortage only occurs when demand goes past R. NL(z) summarizes how large those right-of-R overshoots are on average.

P(stockout)
Frequency
The area of the red tail — tells you how often you will run out of stock.
NL(z)
Magnitude
The weighted average shortage gap — tells you by how much demand overshoots R.

Show the Math

Step-by-step derivation
Step 1
Convert reorder point R to a z-score
z = (R − μX) / σX
Step 2
Evaluate the normal loss function
NL(z) = f(z) − z [1 − F(z)]
Step 3
Convert standardized overshoot to actual units
nR = σX · NL(z)
f(z) = (1/√2π) · exp(−z²/2)   [standard normal PDF]
F(z) = ∫−∞z f(t) dt   [standard normal CDF]

Cost Breakdown

Inventory Education · QR System

QR Cost Landscape

Explore how total annual cost changes across order quantity Q and reorder point R. Use the default 2D heatmap for a quick read, then switch to the optional 3D surface for shape and depth.

Current policy
Optimal policy
Default view: 2D heatmap
Read the landscape in 2D first, then switch to 3D when you want to inspect the cost surface from different angles.

QR cost landscape

Lower-cost regions appear cooler in the default 2D heatmap. Current and optimal policy markers update with the active inputs.

2D heatmap loading area The 2D QR cost landscape renders here when Plotly is available.
3D surface loading area The optional 3D QR cost surface renders here after you switch modes.
Use the heatmap for the fastest read, then switch to 3D when you want to inspect the basin shape.
View states: 2D default · 3D optional · comparison panel updates live

Scenario Comparison

Uncertainty model Mean LT demand LT demand SD P(stockout) Avg units short