Blog / risk
VaR, SVaR and CVaR: A Practical Python Implementation
Value at Risk (VaR) quantifies the maximum expected loss at a given confidence level over a fixed horizon. Conditional VaR (CVaR), also known as Expected Shortfall, measures the average loss in the tail beyond the VaR threshold — a far more informative measure for fat-tailed return distributions.
Equation
where α ∈ (0,1) is the confidence level and R is the portfolio return random variable
What is Value at Risk?
VaR at confidence level α answers: "What is the worst loss I should expect on 95% of days?" Historically this is computed by sorting returns and reading the (1-α) percentile.
Stressed VaR (SVaR)
SVaR is a Basel III requirement. It applies the VaR model to a 12-month window of stressed market conditions (typically the 2008–2009 crisis period). We approximate this by using the worst tercile of historical observations.
CVaR (Expected Shortfall)
CVaR does not ask "what is the boundary of the bad days?" — it asks "on the bad days, how bad is it?" This makes it a coherent risk measure (it satisfies sub-additivity, unlike plain VaR) and is preferred by academics and increasingly by regulators under FRTB.
Conclusion
- Use historical simulation for heavy-tailed assets (crypto, small caps)
- Use parametric VaR only when returns are demonstrably normal
- Always report CVaR alongside VaR — it captures tail risk VaR ignores
- SVaR is a regulatory requirement under Basel III/IV — budget for it