MathFin
Map / Valuation · Credit / MathFin.Models.Credit.DefaultDensity

The default-time density of a deterministic hazard curve

MathFin.Models.Credit.DefaultDensityMSC 91G40MSC 60E05JEL G12 source

Bagaria ch. 16, Calculation 16.2 (eq. 16.2): the protection leg is (1 − R) ∫₀ᵀ P(0,t) λ_t Q(t) dt, with the remark "−dQ/dt = λ_t Q(t), so this is the loss integrated against the density of the default time". Survival is (16.1), Q(t) = P(τ > t) = exp(−∫₀ᵗ λ_s ds), taken with λ deterministic as in §16.1.

Here Q = hazardSurvival h (Models/Credit/HazardCurve.lean) and the density is defaultDensity h t = h t · hazardSurvival h t.

Calculus layer (no probability)

  • hasDerivAt_hazardSurvival — Q' = −λ·Q at t, for h locally integrable and continuous at t.
  • defaultDensity_nonneg — λ ≥ 0 ⇒ f ≥ 0.
  • integral_defaultDensity — ∫ₐᵇ f = Q(a) − Q(b) for continuous h; integral_defaultDensity_zero — ∫₀ᵀ f = 1 − Q(T).

Measure-theoretic layer (a true Lebesgue density of τ's law)

For a random time τ (a.e.-measurable, finite measure space) whose CDF on [0, ∞) is P(τ ≤ a) = 1 − Q(a) — hypothesized, the shape of MathFin.Cox.cox_cdf_timeVarying — with h continuous and ≥ 0:

  • map_eq_withDensity — Law(τ) = Leb.withDensity (1_{[0,∞)}·f) (lawDensity).
  • integral_comp_eq — E[g(τ)] = ∫_{[0,∞)} f·g for measurable g.
  • integral_indicator_Iic_eq — E[D(τ)·1{τ ≤ T}] = ∫₀ᵀ D·f: the (16.2) protection-leg kernel as an expectation, for any measurable discount curve D.
  • expMeasure_eq_withDensity — constant-λ cross-check: lawDensity of the flat curve is Mathlib's expMeasure λ.

Scope: deterministic, continuous hazard (the bootstrapped piecewise-constant curve of §16.4 is not covered); τ is not constructed here, and the stochastic-intensity (Cox mixing) density is not treated.

Main definitions

  • defaultDensity: the default-time density f(t) = λ(t)·Q(t) = λ(t)·exp(−∫₀ᵗ λ) of a deterministic hazard curve h.
  • lawDensity: the density of the law of τ as an ℝ≥0∞-valued function, f on [0, ∞) and zero on (−∞, 0).

Main results

  • hasDerivAt_hazardSurvival: −dQ/dt = λ·Q, for a locally integrable hazard h continuous at t.
  • integral_defaultDensity, integral_defaultDensity_zero: ∫ₐᵇ f = Q(a) − Q(b) and ∫₀ᵀ f = 1 − Q(T) for a continuous hazard.
  • map_eq_withDensity: for a continuous nonnegative hazard h and an a.e.-measurable τ with CDF P(τ ≤ a) = 1 − Q(a) on [0, ∞), the law of τ is volume.withDensity (lawDensity h).
  • integral_comp_eq: under the same hypotheses, E[g(τ)] = ∫_{[0,∞)} f(s)·g(s) ds for measurable g.
  • integral_indicator_Iic_eq: under the same hypotheses, E[D(τ)·1{τ ≤ T}] = ∫₀ᵀ D(s)·λ(s)·Q(s) ds for measurable D and T ≥ 0.
  • expMeasure_eq_withDensity: for constant hazard λ > 0, lawDensity reproduces Mathlib's exponential law.

References

  • S. Bagaria, Notes on Fixed Income Derivative Pricing [BagariaFIDP], ch. 16.

Tags

default density, hazard rate, survival function, protection leg, default time law, CDS pricing, MSC 91G40, MSC 60E05, JEL G12

Import neighbourhood

Above: what it imports. Below: what imports it.

Declarations 14

defMathFin.DefaultDensity.defaultDensitysource
(ℝ → ℝ) → ℝ → ℝ

The default-time density f(t) = λ(t)·Q(t) = λ(t)·exp(−∫₀ᵗ λ) of a deterministic hazard curve h (Bagaria ch. 16, Calculation 16.2). As a function on all of ℝ; the law of τ uses its restriction to [0, ∞) (see map_eq_withDensity).

theoremMathFin.DefaultDensity.hasDerivAt_hazardSurvivalsource
∀ {h : ℝ → ℝ}, LocallyIntegrable h volume → ∀ {t : ℝ}, ContinuousAt h t → HasDerivAt (hazardSurvival h) (-defaultDensity h t) t

−dQ/dt = λ·Q (Bagaria ch. 16, Calc. 16.2): for a locally integrable hazard h continuous at t, the survival curve has derivative −f(t) at t. FTC for ∫₀ᵗ h composed with exp.

theoremMathFin.DefaultDensity.defaultDensity_nonnegsource
∀ {h : ℝ → ℝ}, (∀ (s : ℝ), 0 ≤ h s) → ∀ (t : ℝ), 0 ≤ defaultDensity h t

The density is nonnegative under a nonnegative hazard (Q > 0 always).

theoremMathFin.DefaultDensity.continuous_defaultDensitysource
∀ {h : ℝ → ℝ}, Continuous h → Continuous (defaultDensity h)

The density is continuous for a continuous hazard.

theoremMathFin.DefaultDensity.integral_defaultDensitysource
∀ {h : ℝ → ℝ}, Continuous h → ∀ (a b : ℝ), ∫ (s : ℝ) in a..b, defaultDensity h s = hazardSurvival h a - hazardSurvival h b

Interval default probability: ∫ₐᵇ f = Q(a) − Q(b) for a continuous hazard.

theoremMathFin.DefaultDensity.integral_defaultDensity_zerosource
∀ {h : ℝ → ℝ}, Continuous h → ∀ (T : ℝ), ∫ (s : ℝ) in 0..T, defaultDensity h s = 1 - hazardSurvival h T

Default probability by T: ∫₀ᵀ f = 1 − Q(T) (calculus identity; no τ). This is MathFin.Cox.defaultDensity_antideriv, restated through defaultDensity and hazardSurvival.

defMathFin.DefaultDensity.lawDensitysource
(ℝ → ℝ) → ℝ → ENNReal

The density of τ's law as an ℝ≥0∞-valued function: f on [0, ∞), zero on (−∞, 0).

theoremMathFin.DefaultDensity.measurable_lawDensitysource
∀ {h : ℝ → ℝ}, Continuous h → Measurable (lawDensity h)

lawDensity h is measurable for a continuous hazard.

used by 1: integral_comp_eq
theoremMathFin.DefaultDensity.withDensity_Iicsource
∀ {h : ℝ → ℝ}, Continuous h → (∀ (s : ℝ), 0 ≤ h s) → ∀ {a : ℝ}, 0 ≤ a → (volume.withDensity (lawDensity h)) (Set.Iic a) = ENNReal.ofReal (1 - hazardSurvival h a)

Mass of (−∞, a] under Leb.withDensity (lawDensity h), for a ≥ 0: 1 − Q(a).

theoremMathFin.DefaultDensity.withDensity_Iic_negsource
∀ (h : ℝ → ℝ) {a : ℝ}, a < 0 → (volume.withDensity (lawDensity h)) (Set.Iic a) = 0

Leb.withDensity (lawDensity h) puts no mass on (−∞, a] for a < 0.

theoremMathFin.DefaultDensity.map_eq_withDensitysource
∀ {Ω : Type u_1} {mΩ : MeasurableSpace Ω} {μ : Measure Ω} [IsFiniteMeasure μ] {h : ℝ → ℝ}, Continuous h → (∀ (s : ℝ), 0 ≤ h s) → ∀ {τ : Ω → ℝ}, AEMeasurable τ μ → (∀ (a : ℝ), 0 ≤ a → μ {ω | τ ω ≤ a} = 1 - ENNReal.ofReal (hazardSurvival h a)) → Measure.map τ μ = volume.withDensity (lawDensity h)

The default-time density, measure-theoretically. Let h be a continuous, nonnegative hazard curve and τ an a.e.-measurable random time on a finite measure space whose CDF on [0, ∞) is P(τ ≤ a) = 1 − Q(a) (Q = hazardSurvival h). Then the law of τ is absolutely continuous with Lebesgue density f = λ·Q on [0, ∞) (zero on (−∞, 0)):

Law(τ) = Leb.withDensity (1_{[0,∞)} · ofReal (λ·Q)).

The CDF hypothesis has exactly the shape of the Cox-construction CDF identity MathFin.Cox.cox_cdf_timeVarying (Models/Credit/Cox.lean); τ is hypothesized, not constructed, here.

theoremMathFin.DefaultDensity.integral_comp_eqsource
∀ {Ω : Type u_1} {mΩ : MeasurableSpace Ω} {μ : Measure Ω} [IsFiniteMeasure μ] {h : ℝ → ℝ}, Continuous h → (∀ (s : ℝ), 0 ≤ h s) → ∀ {τ : Ω → ℝ}, AEMeasurable τ μ → (∀ (a : ℝ), 0 ≤ a → μ {ω | τ ω ≤ a} = 1 - ENNReal.ofReal (hazardSurvival h a)) → ∀ {g : ℝ → ℝ}, Measurable g → ∫ (ω : Ω), g (τ ω) ∂μ = ∫ (s : ℝ) in Set.Ici 0, defaultDensity h s * g s

Expectations against the default time (change of variables through the law): for measurable g, E[g(τ)] = ∫_{[0,∞)} f(s)·g(s) ds — no integrability needed (both sides are Bochner integrals, 0 together when non-integrable).

theoremMathFin.DefaultDensity.integral_indicator_Iic_eqsource
∀ {Ω : Type u_1} {mΩ : MeasurableSpace Ω} {μ : Measure Ω} [IsFiniteMeasure μ] {h : ℝ → ℝ}, Continuous h → (∀ (s : ℝ), 0 ≤ h s) → ∀ {τ : Ω → ℝ}, AEMeasurable τ μ → (∀ (a : ℝ), 0 ≤ a → μ {ω | τ ω ≤ a} = 1 - ENNReal.ofReal (hazardSurvival h a)) → ∀ {D : ℝ → ℝ}, Measurable D → ∀ {T : ℝ}, 0 ≤ T → ∫ (ω : Ω), (Set.Iic T).indicator D (τ ω) ∂μ = ∫ (s : ℝ) in 0..T, D s * defaultDensity h s

The protection-leg kernel as an expectation (Bagaria ch. 16, Calc. 16.2 / eq. 16.2, undiscounted loss 1 − R factored out): for any measurable discount curve D (e.g. D t = P(0,t)) and T ≥ 0,

E[D(τ)·1{τ ≤ T}] = ∫₀ᵀ D(s)·λ(s)·Q(s) ds.

theoremMathFin.DefaultDensity.expMeasure_eq_withDensitysource
∀ {r : ℝ}, 0 < r → expMeasure r = volume.withDensity (lawDensity fun x => r)

Cross-check against Mathlib's exponential law (constant hazard λ > 0): the lawDensity of the flat curve reproduces expMeasure λ, the law that MathFin.PoissonInterarrival.map_firstArrival_eq_expMeasure (Probability/Jumps/PoissonInterarrival.lean) assigns to the first arrival of a rate-λ Poisson process. Obtained from map_eq_withDensity with τ = id.