ES Expected Shortfall (CVaR)
When VaR breaks, how bad does it actually get?
Learning Objectives
- •Understand Expected Shortfall and why it replaced VaR in Basel III
- •Compute and interpret CVaR on real return data
- •Know how ES informs practical risk thresholds
- •See the difference between VaR and CVaR on the same distribution
Explain Like I'm 5
VaR says "you probably won't lose more than X." Expected Shortfall says "okay, but when you DO lose more than X, the average loss will be Y." It answers the follow-up question that VaR leaves hanging — how bad does the tail actually get?
Think of It This Way
If VaR is a speed limit sign, Expected Shortfall tells you the average speed of the cars that are breaking the speed limit. Knowing that some cars speed isn't enough — you need to know if they're doing 70 in a 65 zone or 120. ES gives you that picture.
1Why ES Fixes VaR's Biggest Problem
2Same VaR, Different Tail Risk
VaR vs CVaR — Same VaR, Different Tail Risk
3ES in Practical Risk Management
4Sub-Additivity: Why the Math Matters
5ES/VaR Ratio — A Quick Diagnostic
ES/VaR Ratio by Asset Class (95% Confidence)
Key Formulas
Expected Shortfall
Average of all VaR levels beyond the confidence threshold. This captures the entire tail, not just the boundary. For discrete samples: average all returns worse than VaR.
Discrete ES
Sort returns worst to best. Average the worst (1-α)×n returns. That's your ES. Simple and model-free.
Hands-On Code
VaR vs Expected Shortfall
import numpy as np
def var_and_es(returns, confidence=0.95):
"""Compute both VaR and Expected Shortfall."""
alpha = 1 - confidence
sorted_returns = np.sort(returns)
cutoff = int(len(returns) * alpha)
var = -sorted_returns[cutoff]
es = -sorted_returns[:cutoff].mean()
print(f"{confidence:.0%} VaR: {var:.2%}")
print(f"{confidence:.0%} ES: {es:.2%}")
print(f"ES/VaR ratio: {es/var:.2f}x")
print(f" Tail is {es/var:.2f}x worse than VaR boundary")
return var, esThe ES/VaR ratio tells you about tail severity. Normal distributions give ~1.2×. Real financial data often runs 1.5–2×. That gap is why VaR alone is dangerous.
Knowledge Check
Q1.Two portfolios have 95% VaR = 5%. Portfolio A has ES = 6%, Portfolio B has ES = 20%. Which is riskier?
Assignment
Generate returns from both a normal distribution and a Student-t distribution (df=3). Compute VaR and ES for both. The t-distribution should show a much larger ES/VaR ratio — that's fat tails making VaR misleading.