credit-risk-modelslisted
Install: claude install-skill howard-lynn-ye/fin-skills
# Credit risk models
**Two model families each produce a number called "the probability of default", and they are not
the same number.** Merton's `N(−d2)` is **risk-neutral**; a rating-agency default table is
**physical**. Using one where the other belongs is the most expensive mistake in this domain, and
neither one carries a label.
Every figure below is printed by `scripts/credit_models.py` (runs in **1.8 s**; QuantLib optional,
imported inside `quantlib_cds_cross_check`). ✅ Measured means this file produced it on 2026-09-09
with QuantLib 1.43, scipy 1.13.0, Python 3.11.3.
> **The rule:** `N(−d2)` is risk-neutral; a rating-table default rate is physical. **Price with
> the first, forecast with the second**, and never quote a hazard without its recovery.
## 1. ✅ Merton (1974), reproducing a textbook example
Equity is a call on the firm's assets struck at the face value of debt. Two equations pin the two
unobservables:
E = V N(d1) - D e^{-rT} N(d2)
sigma_E = N(d1) sigma_V V / E
⚠️ **The reference:** Hull, *Options, Futures, and Other Derivatives*, the worked example in the
credit-risk chapter on using equity prices to estimate default probabilities. **Inputs:
E = 3, sigma_E = 80%, D = 10 payable in 1 year, r = 5%.** The book reports V = 12.40,
sigma_V = 0.2123, N(−d2) = 12.7%, debt worth 9.40 against a promised PV of 9.51, and an expected
loss of about 1.2%. Those published values are secondhand; everything in the "solved" column is
✅ measured here.
| qua