Class CreditCurve

java.lang.Object
com.quantfinlib.credit.CreditCurve

public final class CreditCurve extends Object
CREDIT CURVE — piecewise-constant hazard rates bootstrapped from CDS par spreads, the credit market's exact analogue of YieldCurve's bootstrap: walk the quotes from shortest to longest, at each pillar solving for the one hazard rate that reprices that maturity's CDS to zero upfront given everything already solved.

The objects: the HAZARD RATE h(t) is the instantaneous default intensity ("conditional on surviving to t, the annualized probability of defaulting right now"); SURVIVAL is its exponential integral, Q(t) = exp(-integral of h) — piecewise-constant h makes that a product of exponentials, evaluated exactly. The rule-of-thumb every desk carries — the CREDIT TRIANGLE spread ~ h * (1 - R) — falls out of setting premium = protection on a flat curve, and the tests pin this class against it.

Leg discretization (stated): quarterly grid, premium leg S * sum 0.25 * DF(t_i) * Q(t_i) plus the standard accrual-on-default half-period term, protection leg (1-R) * sum DF(t_i) * (Q(t_{i-1}) - Q(t_i)) with discounting at period end — the textbook discrete form (O(dt) bias vs the integral, ~0.1bp at these grids, stated not hidden). Recovery is a single number for the whole curve, the market's quoting convention (40% senior unsecured). Solving is bisection per pillar on h in [1e-9, 10] with an explicit bracket check — a quote no hazard can explain throws rather than returning the bound. Research lane, deterministic.

  • Method Details

    • bootstrap

      public static CreditCurve bootstrap(int[] tenorYears, double[] parSpreads, double recovery, YieldCurve discount)
      Bootstraps from CDS par spreads.
      Parameters:
      tenorYears - ascending integer-year pillars, ≥ 1
      parSpreads - par CDS spreads (decimal: 0.01 = 100bp), > 0
      recovery - assumed recovery rate in [0, 1)
      discount - risk-free discounting curve
    • survivalProbability

      public double survivalProbability(double t)
      Survival probability Q(t), exact under piecewise-constant hazards.
    • defaultProbability

      public double defaultProbability(double t)
      Cumulative default probability 1 - Q(t).
    • hazard

      public double hazard(double t)
      The hazard rate in force at time t (flat beyond the last pillar).
    • recovery

      public double recovery()