Skip to main content

Module survival

Module survival 

Expand description

Credit term structures: survival probability and hazard rate.

A separate closed set from the discount families, and deliberately so. The vocabulary here is survival probability and hazard rate, not discount factor and zero rate; sharing one enum would mean one of the two carrying methods it cannot answer. Everything else is the same discipline as the discount side — storage holds f64 and no AD state, a lift produces a mode view that borrows it, and the evaluation trait says only what a curve is.

Each family carries its own day count. That is not dead configuration: a hazard rate is quoted under a convention, and ISDA names ACT/365F for the integration specifically, so the curve has to know which one it means.

Macros§

dispatch 🔒
Dispatch one SurvivalProbability method across every variant.

Structs§

DensitySurvival
A survival curve stated by its default density, f(t) = −dS/dt.
DensitySurvivalView
DensitySurvival lifted into one pricing mode.
FlatHazard
A constant-hazard curve: S(t) = exp(−h·τ), h(t) = h.
FlatHazardView
FlatHazard lifted into one pricing mode.
IsdaSurvival
The ISDA-standard piecewise-flat-hazard curve — what a CDS bootstrap returns.
IsdaSurvivalView
IsdaSurvival lifted into one pricing mode.
PiecewiseSurvival
A survival curve stored as log-survival at dated pillars — the credit analogue of the piecewise discount curve, and interchangeable with IsdaSurvival behind the evaluation trait.
PiecewiseSurvivalView
PiecewiseSurvival lifted into one pricing mode.
ScaledSurvival
A base credit curve whose hazard is multiplied by a piecewise-constant term structure: β_k on the segment ending at the k-th scaling pillar (right-closed, as the ISDA family’s segments are), the last β past it.
ScaledSurvivalView
ScaledSurvival lifted into one pricing mode.
ShockedSurvival
A base credit curve under a named parallel hazard shock: h(t) + Δ, and so S(t)·exp(−Δ·τ).
ShockedSurvivalView
ShockedSurvival lifted into one pricing mode.

Enums§

Survival
A stored credit term structure. Passive parameters, no AD state.
SurvivalView
A Survival lifted into one pricing mode.

Traits§

SurvivalProbability
What a credit pricer sees. Two questions, one mode, no AD vocabulary.

Functions§

fast_basis 🔒
The constant divisor K for a convention that is exactly actual_days / K, or None for every convention that is not — the classification that lets an ordinal query measure time by integer subtraction. Exhaustive with no wildcard on purpose: a new convention must be classified here or the crate stops compiling, because defaulting one into the fast path would return a plausible wrong year fraction on every credit query rather than failing.
year_fraction_fast 🔒
The year fraction from from_ordinal to ordinal under a fast basis — bit-identical to day_count.year_fraction(from, to) for the conventions fast_basis admits, because actual_days is exactly this integer difference widened and divided.