normalCDF = x => {
const a1 = 0.254829592, a2 = -0.284496736, a3 = 1.421413741
const a4 = -1.453152027, a5 = 1.061405429, p = 0.3275911
const sign = x < 0 ? -1 : 1
const z = Math.abs(x) / Math.sqrt(2)
const t = 1.0 / (1.0 + p * z)
const y = 1 - (((((a5 * t + a4) * t) + a3) * t + a2) * t + a1) * t * Math.exp(-z * z)
return 0.5 * (1 + sign * y)
}Expected Shortfall for the Vasicek Distribution
Compare credit VaR and Expected Shortfall under the Vasicek portfolio loss distribution, and see why ES is monotone in ρ while VaR can be non-monotonic for low PD
Expected Shortfall (ES) is the average loss conditional on the loss exceeding the VaR threshold:
\[ ES^{1-p} \;=\; \mathbb{E}\!\left[L \,\middle|\, L \geq VaR^{1-p}\right] \]
For the Vasicek loss distribution, ES has a useful closed-form involving the bivariate normal CDF (Gordy 2003):
\[ ES^{1-p} \;=\; \frac{1}{p}\,\Phi_{2}\!\left(\Phi^{-1}(PD),\; -\Phi^{-1}(1 - p);\; \sqrt{\rho}\right) \]
where \(\Phi_2(\cdot, \cdot; r)\) is the bivariate standard normal CDF with correlation \(r\). We compute \(\Phi_2\) numerically via an accurate Drezner–Wesolowsky-style approximation.
Three reasons to care about ES in credit portfolios:
- Coherent (subadditive). Merging two loan books cannot increase measured risk beyond the sum of parts, unlike VaR.
- Tail-sensitive. Captures the magnitude of losses beyond VaR, not just where the tail begins — matters for the heavily right-skewed Vasicek distribution.
- Monotone in \(\rho\). ES rises with correlation everywhere, whereas VaR can exhibit a non-monotonic edge case at very low \(PD\) and high \(\rho\).
Inputs
Tip
How to experiment
Start with PD = 0.5% and the confidence level at 99%. Sweep ρ from 0 toward 1: the VaR curve in the sweep tab rises, then turns and falls slightly — the famous low-PD non-monotonicity. ES, by contrast, rises all the way. Now push PD up to 5%: both measures rise monotonically and the gap between them (ES − VaR) widens with ρ, a clean measure of tail thickness.
Note
Why is the gap larger when PD is lower?
The Vasicek distribution becomes more right-skewed as PD shrinks at any given ρ:
- Low PD means most of the probability mass sits near 0 (good states, where the common factor \(F\) is at or above its mean and almost no loans default). The tail consists of rare scenarios in which \(F\) is deeply negative and almost everyone defaults at once. The loss distribution is almost bimodal: mass near 0 plus a long, thin spike toward 1.
- The 99% VaR marks just the start of that tail. Because the tail is sparse, VaR can land at a relatively modest loss level.
- ES averages the entire tail beyond VaR, including those near-total-default scenarios. With low PD and high ρ, those extreme scenarios sit far above where VaR cuts in, so the average of the tail is much larger than its threshold. Hence ES − VaR widens.
As PD rises, the conditional default probability is already non-trivial in the bulk; the tail is not pulled as far above the body of the distribution, so VaR catches up to ES and the gap shrinks. Algebraically: as PD → 0, \(\Phi^{-1}(PD) \to -\infty\), and the integrand defining ES is dominated by the “all-default” region near 1, while VaR sits much lower; the ratio ES/VaR diverges. As PD → α, the distribution becomes more symmetric and ES/VaR → 1.
Stylized takeaway. Investment-grade portfolios (low PD) with realistic correlations are exactly the regime where reading just VaR can badly understate tail exposure — which is why ES is favoured for credit and was adopted by Basel III FRTB for market risk.
Note
Regulatory trend. Basel III’s Fundamental Review of the Trading Book (FRTB) replaced 99% 10-day VaR with 97.5% 10-day ES for market risk capital. Credit risk in the banking book (IRB) is still anchored to a 99.9% Vasicek VaR, but economic-capital and stress-testing practice increasingly uses ES for credit portfolios precisely because it is tail-aware and coherent.
References
Gordy, Michael B. 2003. “A Risk-Factor Model Foundation for Ratings-Based Bank Capital Rules.” Journal of Financial Intermediation 12 (3): 199–232.