Lesson 4 of 15

Conditional VaR (CVaR / Expected Shortfall)

Conditional VaR (CVaR / Expected Shortfall)

VaR tells you the threshold loss at a confidence level, but not how bad things get beyond that threshold. CVaR (also called Expected Shortfall) fills this gap by averaging all losses that exceed the VaR.

Formula

CVaR = -mean(returns that fall in the tail)

Concretely, using historical returns:

  1. Sort returns ascending
  2. idx = int((1 - confidence) × n)
  3. Tail = sorted_returns[:idx]
  4. If idx == 0 (very small sample), use just the worst return: [sorted_returns[0]]
  5. CVaR = -mean(tail)

CVaR vs VaR

MetricMeaning
VaR 95%Worst loss exceeded only 5% of the time
CVaR 95%Average loss in that worst 5%

CVaR is a coherent risk measure (satisfies sub-additivity), whereas VaR is not.

Example

20 returns at 85% confidence:
idx = int(0.15 × 20) = 3
tail = 3 worst returns → CVaR = average of those 3

Python runtime loading...
Loading...
Click "Run" to execute your code.