Chapter 15 — Credit Risk and Credit Derivatives

"Credit is trust. Credit risk is the mathematics of broken trust."


Learning objectives: After completing this chapter you will be able to:

  • Derive the Merton structural model of credit risk and implement the iterative equity-implied asset value calibration
  • Explain reduced-form hazard rate models and the survival probability formula
  • Bootstrap a term structure of hazard rates from market CDS par spreads
  • Price and mark-to-market a credit default swap using fee-leg and protection-leg cash flow integration
  • Decompose a credit spread into the default premium, liquidity premium, and convexity contribution

In 1974, Robert Merton published "On the Pricing of Corporate Debt: The Risk Structure of Interest Rates," applying the Black-Scholes options pricing framework to a question that had puzzled economists for decades: why do corporate bonds yield more than government bonds of the same maturity? His answer was elegant: a company that issues a bond is effectively giving the bondholders the firm's assets and receiving a call option to buy them back by repaying the debt at maturity. If the firm's assets fall below the face value of the debt, the firm defaults and the bondholders receive the assets. If assets exceed the debt, shareholders exercise their option, repay the bondholders, and keep the surplus. Corporate debt and equity are therefore both derivative instruments written on the same underlying: the total value of the firm.

This structural insight gave credit risk a mathematical framework for the first time. But structural models face a practical limitation: firm asset value is not directly observable. The reduced-form approach, pioneered by Jarrow-Turnbull (1995) and Duffie-Singleton (1999), takes a different route: model the default process directly as a Poisson arrival with a hazard rate $\lambda(t)$, and calibrate it to market prices of credit instruments. This approach drives the credit default swap (CDS) market, which grew from virtually nothing in 1995 to $60 trillion in notional outstanding by 2007 — making it one of the fastest-growing derivatives markets in history, as well as one of the most significant contributors to the 2008 financial crisis.

This chapter covers both approaches and implements the central instrument: the credit default swap, which transfers default risk between buyer and seller, and whose pricing requires bootstrapping a term structure of survival probabilities from market quotes.


15.1 Credit Risk Fundamentals

Credit risk is the risk that a counterparty defaults on its obligations. The key metrics are:

  • Probability of Default (PD): $\lambda(t)$ — hazard rate
  • Loss Given Default (LGD): $(1 - R)$ where $R$ is the recovery rate
  • Exposure at Default (EAD): the outstanding notional at default time

The survival probability to time $T$ given a constant hazard rate $\lambda$:

$$Q(T) = P(\tau > T) = e^{-\lambda T}$$

module Credit = struct

  (** Constant hazard rate model *)
  let survival_prob ~hazard_rate ~tau = exp (-. hazard_rate *. tau)

  let default_prob ~hazard_rate ~tau = 1.0 -. survival_prob ~hazard_rate ~tau

  (** Conditional default probability in [t, t+dt] given survival to t *)
  let conditional_default_prob ~hazard_rate ~t1 ~t2 =
    let q1 = survival_prob ~hazard_rate ~tau:t1 in
    let q2 = survival_prob ~hazard_rate ~tau:t2 in
    (q1 -. q2) /. q1   (* P(default in [t1,t2] | survived to t1) *)

  (** If we observe market spread s and recovery R, back out hazard rate:
      s ≈ λ(1 - R) for small spreads *)
  let hazard_from_spread ~spread ~recovery =
    spread /. (1.0 -. recovery)

  (** Implied spread from hazard rate *)
  let spread_from_hazard ~hazard_rate ~recovery = hazard_rate *. (1.0 -. recovery)

  type credit_curve = {
    tenors   : float array;  (* years *)
    hazards  : float array;  (* piecewise-constant hazard rates between tenors *)
  }

  (** Survival probability under piecewise-constant hazard curve *)
  let survival_pw_const curve t =
    let n = Array.length curve.tenors in
    let acc = ref 0.0 in
    let remaining = ref t in
    let i = ref 0 in
    while !i < n && !remaining > 0.0 do
      let t_start = if !i = 0 then 0.0 else curve.tenors.(!i - 1) in
      let t_end   = curve.tenors.(!i) in
      let dt      = Float.min !remaining (t_end -. t_start) in
      acc := !acc +. curve.hazards.(!i) *. dt;
      remaining := !remaining -. dt;
      incr i
    done;
    if !remaining > 0.0 then
      acc := !acc +. curve.hazards.(n - 1) *. !remaining;
    exp (-. !acc)

end

15.2 The Merton Model

Merton's 1974 insight is striking in its simplicity: at maturity $T$, shareholders receive $\max(V_T - D, 0)$ — where $V_T$ is the total firm value and $D$ is the face value of debt. Equity is literally a call option on the firm with strike $D$. Bondholders receive $\min(V_T, D) = D - \max(D - V_T, 0)$: a risk-free bond minus a put option on the firm. The credit spread is the put premium expressed as a yield.

Merton Structural Model Figure 15.1 — The Merton model visualised. Firm value follows a stochastic process. Default occurs if the firm's asset value falls below the debt face value threshold $D$ at maturity.

Since we can price calls using Black-Scholes, we can price risky debt and compute credit spreads analytically:

$$E = V N(d_1) - D e^{-rT} N(d_2), \qquad d_1 = \frac{\ln(V/D) + (r + \sigma_V^2/2)T}{\sigma_V\sqrt{T}}, \quad d_2 = d_1 - \sigma_V\sqrt{T}$$

The credit spread — the excess yield over the risk-free rate — follows directly. Risk-neutral default probability is $N(-d_2)$ and the distance-to-default $DD = d_2$ provides an intuitive measure: it is the number of standard deviations by which the expected asset value exceeds the debt face value. KMV (now Moody's Analytics) built a highly successful commercial default prediction product on this concept, enhanced by mapping the Merton distance-to-default to empirically calibrated physical default probabilities.

The practical challenge is that $V$ and $\sigma_V$ are not directly observable. The solution is to use the two observable quantities — equity price $E$ and equity volatility $\sigma_E$ — to infer them via the two equations:

  1. $E = V N(d_1) - D e^{-rT} N(d_2)$ (Merton call pricing formula)
  2. $E \sigma_E = V \sigma_V N(d_1)$ (Itô's lemma applied to the equity-asset relationship)

These form a non-linear system in $(V, \sigma_V)$ that must be solved iteratively, typically with a fixed-point or Newton's method algorithm.

module Merton = struct

  (** Given equity value E and equity vol σ_E, solve for asset value V and σ_V.
      System: E = V*N(d1) - D*e^{-rT}*N(d2)
              E*σ_E = V*σ_V*N(d1)  *)
  type solved = {
    asset_value    : float;
    asset_vol      : float;
    distance_to_default : float;  (* DD = (ln(V/D) + (μ - σ²/2)T) / (σ√T) *)
    default_prob   : float;       (* N(-DD) under physical measure *)
  }

  let d1 ~v ~d ~r ~sigma_v ~tau =
    (log (v /. d) +. (r +. 0.5 *. sigma_v *. sigma_v) *. tau) /. (sigma_v *. sqrt tau)

  let d2 ~v ~d ~r ~sigma_v ~tau =
    d1 ~v ~d ~r ~sigma_v ~tau -. sigma_v *. sqrt tau

  (** Solve iteratively for V and σ_V given E and σ_E *)
  let calibrate ~equity ~equity_vol ~debt ~rate ~tau =
    (* Fixed-point iteration: start with V = E + D, σ_V = E*σ_E / (E+D) *)
    let v    = ref (equity +. debt) in
    let sv   = ref (equity *. equity_vol /. !v) in
    for _ = 0 to 999 do
      let d1_ = d1 ~v:!v ~d:debt ~r:rate ~sigma_v:!sv ~tau in
      let nd1 = Numerics.norm_cdf d1_ in
      let nd2 = Numerics.norm_cdf (d1_ -. !sv *. sqrt tau) in
      let e_  = !v *. nd1 -. debt *. exp (-. rate *. tau) *. nd2 in
      let v_new  = equity +. debt *. exp (-. rate *. tau) *. Numerics.norm_cdf
                     (-. d2 ~v:!v ~d:debt ~r:rate ~sigma_v:!sv ~tau) in
      let sv_new = equity *. equity_vol /. Float.max 1e-6 (!v *. nd1) in
      ignore e_;
      v := v_new; sv := sv_new
    done;
    let dd = d1 ~v:!v ~d:debt ~r:rate ~sigma_v:!sv ~tau -. !sv *. sqrt tau in
    { asset_value = !v; asset_vol = !sv;
      distance_to_default = dd;
      default_prob = Numerics.norm_cdf (-. dd) }

  (** Credit spread from Merton: s = -ln(N(d2) + E/D*N(-d1)) / T - r *)
  let credit_spread ~v ~d ~r ~sigma_v ~tau =
    let d2_ = d2 ~v ~d ~r ~sigma_v ~tau in
    let d1_ = d1 ~v ~d ~r ~sigma_v ~tau in
    let debt_pv_with_default = d *. Numerics.norm_cdf d2_
                               +. v *. Numerics.norm_cdf (-. d1_) in
    -. log (debt_pv_with_default /. (d *. exp (-. r *. tau))) /. tau

end

15.3 Reduced-Form Models and Credit Spread Decomposition

Reduced-form models take the default process as given without modelling the underlying firm economics. Default is modelled as the first jump of a Poisson process with intensity $\lambda(t)$, so the survival probability is:

$$Q(T) = E\left[e^{-\int_0^T \lambda(t)dt}\right]$$

For a constant hazard rate $\lambda$, this gives $Q(T) = e^{-\lambda T}$. For piecewise-constant $\lambda$, the integral becomes a sum and $Q(T) = e^{-\sum_i \lambda_i \Delta t_i}$.

The most important practical formula is the simplified spread-hazard relationship:

$$s \approx \lambda (1 - R)$$

where $s$ is the CDS spread, $\lambda$ is the hazard rate, and $R$ is the recovery rate. This approximation holds when $\lambda$ and $r$ are small relative to 1/maturity. It allows quick mental arithmetic: a 5Y bond with 100 bp CDS spread and 40% recovery implies $\lambda \approx 100/(60) = 1.67%$ per year, or roughly a 1.67% annual default probability.

In practice, the observable CDS spread decomposes into three conceptually distinct components:

  1. Default premium: The actuarially fair compensation for expected loss, $\approx \lambda(1-R)$. This is what the hazard rate captures.

  2. Liquidity premium: Corporate bonds and CDS are less liquid than government bonds, so investors demand additional compensation to hold them. For investment-grade bonds, the liquidity premium can be 10–30 bps of the spread; for high-yield it can be 50–150 bps.

  3. Convexity / risk premium: The marginal compensation for the fact that defaults tend to cluster in bad economic states (systematic credit risk). Unlike idiosyncratic default risk, systematic default risk cannot be diversified away and commands a risk premium even in well-diversified portfolios.

Empirical studies (e.g., Longstaff, Mithal, Neis 2005) found that roughly 70–80% of investment-grade spreads can be attributed to default risk (the actuarial component), with the remaining 20–30% attributable to the liquidity premium. For high-yield bonds at peak crisis stress, the risk premium can dominate entirely — this is why high-yield spreads widened to 2000+ bps in late 2008 even though default rates peaked below 15%.

The Jarrow-Turnbull model postulates $\lambda(t) = a + b \cdot r(t)$, building a correlation between credit spreads and interest rates. This is economically justified: when rates are high, the economy is typically strong and defaults are rare; when rates fall sharply (often in recessions), default rates tend to increase.


15.4 Credit Default Swaps (CDS)

A CDS is the most liquid credit derivative. The protection buyer pays a periodic fee (spread $s$) and receives $(1-R)$ upon default.

CDS pricing: fair spread such that PV(fee leg) = PV(protection leg).

$$\text{PV(fee)} = s \sum_{i=1}^n \Delta_i \cdot e^{-r_i T_i} \cdot Q(T_i)$$

$$\text{PV(protection)} = (1-R) \int_0^T e^{-r(t)} \left(-\frac{dQ}{dt}\right) dt$$

module Cds = struct

  type t = {
    notional    : float;
    spread      : float;         (* annual premium in bps /. 10000 *)
    recovery    : float;         (* R = 0.40 typically *)
    payment_freq: int;           (* payments per year, typically 4 *)
    maturity    : float;         (* years *)
  }

  (** CDS fee leg PV *)
  let fee_leg ~cds ~discount_curve ~hazard_curve =
    let n    = int_of_float (cds.maturity *. float_of_int cds.payment_freq) in
    let dt   = 1.0 /. float_of_int cds.payment_freq in
    let pv   = ref 0.0 in
    for i = 1 to n do
      let t  = float_of_int i *. dt in
      let df = Interpolation.discount_factor discount_curve t in
      let q  = Credit.survival_pw_const hazard_curve t in
      pv := !pv +. cds.spread *. dt *. df *. q
    done;
    cds.notional *. !pv

  (** CDS protection leg PV (numerical integration) *)
  let protection_leg ~cds ~discount_curve ~hazard_curve =
    let n_steps = 360 in
    let dt      = cds.maturity /. float_of_int n_steps in
    let pv      = ref 0.0 in
    for i = 0 to n_steps - 1 do
      let t1 = float_of_int i *. dt in
      let t2 = float_of_int (i + 1) *. dt in
      let q1 = Credit.survival_pw_const hazard_curve t1 in
      let q2 = Credit.survival_pw_const hazard_curve t2 in
      let tm = (t1 +. t2) /. 2.0 in
      let df = Interpolation.discount_factor discount_curve tm in
      pv := !pv +. df *. (1.0 -. cds.recovery) *. (q1 -. q2)
    done;
    cds.notional *. !pv

  (** Fair CDS spread: spread such that fee_leg = protection_leg *)
  let fair_spread ~recovery ~discount_curve ~hazard_curve ~maturity ~payment_freq () =
    let dummy = { notional = 1.0; spread = 1.0; recovery; payment_freq; maturity } in
    let fee_1bp = fee_leg ~cds:dummy ~discount_curve ~hazard_curve in
    let prot    = protection_leg ~cds:dummy ~discount_curve ~hazard_curve in
    prot /. fee_1bp  (* spread in unit premium *)

  (** Mark-to-market of existing CDS *)
  let mtm ~cds ~discount_curve ~hazard_curve =
    let fl = fee_leg ~cds ~discount_curve ~hazard_curve in
    let pl = protection_leg ~cds ~discount_curve ~hazard_curve in
    pl -. fl

  (**
      Bootstrap hazard curve from market CDS spreads.
      Given par spreads at tenors [1Y, 2Y, 3Y, 5Y, 7Y, 10Y], solve iteratively
      for piecewise-constant hazard rates. 
  *)
  let bootstrap_hazard_curve ~tenors ~par_spreads ~recovery ~discount_curve () =
    let n       = Array.length tenors in
    let hazards = Array.make n 0.0 in
    let curve   = { Credit.tenors; hazards } in
    for i = 0 to n - 1 do
      (* Binary search for hazard in [tenors.(i-1), tenors.(i)] *)
      let lo = ref 0.0001 and hi = ref 2.0 in
      for _ = 0 to 99 do
        let mid = (!lo +. !hi) /. 2.0 in
        curve.Credit.hazards.(i) <- mid;
        let cds = { notional = 1.0; spread = par_spreads.(i); recovery;
                    payment_freq = 4; maturity = tenors.(i) } in
        let mtm_ = mtm ~cds ~discount_curve ~hazard_curve:curve in
        if mtm_ > 0.0 then lo := mid else hi := mid
      done;
      hazards.(i) <- (!lo +. !hi) /. 2.0
    done;
    curve

end

15.5 CDS Index and Seniority

CDX / iTraxx are standardised CDS indices on 125 reference entities. The index spread is:

$$s_{\text{index}} \approx \frac{1}{125} \sum_{i=1}^{125} s_i$$

Products also exist at different seniority levels (senior, sub, equity tranche).


15.6 Chapter Summary

Credit risk occupies a unique position in quantitative finance: it combines the precision of derivatives mathematics with the irreducible uncertainty of human and institutional behaviour. The probability that a counterparty will default is inherently difficult to measure, model, and price.

Merton's structural model provides deep intuition: equity is a call option on the firm's assets, and the credit spread is the (risk-neutral) reward demanded for selling default insurance. The distance-to-default measure $DD = (\ln(V/D) + (\mu - \sigma^2/2)T) / (\sigma\sqrt{T})$ has good empirical predictive power for near-term default probability, and forms the basis of the KMV/Moody's EDF model used in commercial credit risk systems. The limitation is that firm asset value $V$ is unobservable; it must be inferred from equity price and volatility via an iterative calibration.

Reduced-form models sidestep this by modelling default as a Poisson process with hazard rate $\lambda(t)$. The credit survival probability is $Q(T) = e^{-\int_0^T \lambda(t) dt}$, and for piecewise-constant $\lambda$ this simplifies to $e^{-\lambda_i (T_i - T_{i-1})}$ on each segment. Bootstrapping from CDS market quotes — using each tenor in turn to pin down the next hazard rate segment — is directly analogous to yield curve bootstrapping in Chapter 7, and the implementation mirrors it closely.

The CDS is to credit risk what the vanilla swap is to interest rates: it is the liquid benchmark that defines the credit curve. The fair spread $s$ balances the present value of the fee leg (protection buyer pays $s$ per quarter while the reference entity survives) against the present value of the protection leg (protection seller pays $(1-R)$ if default occurs). Both legs require integrating over the survival curve, and the computation is straightforward once the hazard rates have been bootstrapped.


Exercises

15.1 [Basic] Implement a term structure of default probabilities given piecewise-constant hazard rates. Plot $Q(T)$ for $\lambda_1 = 0.02$ (0–3Y), $\lambda_2 = 0.04$ (3–7Y), $\lambda_3 = 0.06$ (7–10Y). Verify the approximation $s \approx \lambda(1-R)$ for $R = 40%$.

15.2 [Intermediate] Calibrate the Merton model: given equity $E = 80$, equity vol $\sigma_E = 30%$, debt face value $D = 100$, risk-free rate $r = 5%$, maturity $T = 1$. Report $V$, $\sigma_V$, distance-to-default, Merton default probability, and credit spread.

15.3 [Intermediate] Implement CDS bootstrapping from 5 par spreads (1Y: 50 bp, 2Y: 80 bp, 3Y: 100 bp, 5Y: 130 bp, 10Y: 160 bp) with flat discount at 3% and recovery $R = 40%$. Plot the bootstrapped hazard rates and survival curve.

15.4 [Intermediate] Study CDS MTM sensitivity: for a 5Y CDS with 100 bp coupon spread, mark-to-market the position when the parallel hazard rate shifts by $\pm 10$ bp. Also study how MTM changes as $R$ varies from 20% to 60%.

15.5 [Advanced] Decompose a BBB corporate bond's spread into default and non-default components using the CDS-cash basis methodology: (a) price the bond assuming the hazard rates you bootstrapped from CDS; (b) the difference between the observed yield spread and the CDS-implied spread is the non-default (liquidity/risk premium) component. How does this decomposition change between 2006 and 2009 for a simulated spread time series?

15.6 [Advanced] Implement the KMV-style distance-to-default calculation for a panel of 10 simulated firms with varying leverage ratios. Rank them by distance-to-default and compare to simple leverage-based ranking.


Next: Chapter 16 — Portfolio Credit Derivatives