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)
}Conditional Default Probability in the Factor Model
How the single-factor default probability Pr(default | F) depends on the common factor F, unconditional PD, and asset correlation ρ in the Vasicek factor model
The Vasicek factor model assumes every firm’s standardized asset shock decomposes into a common and an idiosyncratic component with equi-correlation \(\rho\) (Christoffersen 2012, chap. 12; Vasicek 2002):
\[ z_i = \sqrt{\rho}\,F + \sqrt{1 - \rho}\,\tilde z_i, \qquad F,\,\tilde z_i \sim N(0, 1) \text{ independent} \]
Firm \(i\) defaults when \(z_i < \Phi^{-1}(PD)\). Conditional on the realised value of the common factor \(F\), defaults are independent across firms and the probability of default is the same for all firms:
\[ \Pr[\text{default} \mid F] \;=\; \Phi\!\left(\frac{\Phi^{-1}(PD) - \sqrt{\rho}\,F}{\sqrt{1 - \rho}}\right) \]
This is the engine of the portfolio loss distribution. Bad macro states (large negative \(F\)) inflate the conditional default probability for every firm simultaneously — the mechanism behind correlated defaults.
Inputs
Tip
How to experiment
Fix PD at 2% and sweep \(\rho\) from 0 to 0.5. At \(\rho = 0\) the conditional default probability is flat at PD — there is no systematic component. As \(\rho\) increases, the curve steepens around zero: bad-factor realisations push the conditional PD well above its unconditional value. Check the stress-scenario readout: a three-sigma adverse \(F\) moves PD from 2% to a much higher number whose magnitude depends almost entirely on \(\rho\).
Note
Two limiting cases. At \(\rho \to 0\) the conditional PD collapses to the unconditional \(PD\) regardless of \(F\); defaults are independent and diversification works cleanly. At \(\rho \to 1\) the conditional PD is either 0 or 1 depending on the sign of \(F - \Phi^{-1}(PD) / \sqrt{\rho}\); the whole portfolio defaults together or survives together, and no diversification is possible. Empirical corporate values of \(\rho\) under Basel IRB sit in \([0.12, 0.24]\), firmly in the intermediate regime.
References
Christoffersen, Peter F. 2012. Elements of Financial Risk Management. 2nd ed. Academic Press.
Vasicek, Oldrich. 2002. “The Distribution of Loan Portfolio Value.” Risk 15 (12): 160–62.