Function calibrate_survival_density
pub fn calibrate_survival_density(
reference: NaiveDate,
discount: &Curve,
rungs: &[Rung],
recovery: Option<f64>,
fixings: &FixingStore,
fx: &FxRates,
tolerance: Tolerance,
day_count: DayCountFraction,
) -> Result<CalibratedDensity, CalibrationError>Expand description
Calibrates a default-density survival curve to a ladder of credit default swaps, discounted on a curve already known, the density linear between pillars.
The same pillar-by-pillar Newton as calibrate_survival, on the
density at each pillar rather than the segment hazard: a contract to
pillar j reads no density beyond it, so the ladder is triangular. The
density at the reference date is the first pillar’s, so the first
segment is flat, and the
curve carries one parameter per rung. The ladder is read back, checked and
inverted exactly as the hazard ladder’s, so the curve pins with its
provenance and its refit.
§Errors
As calibrate_survival, with a pillar solving to a negative density
reported as CalibrationError::NegativeHazard carrying the density.