Struct CreditLadder
struct CreditLadder<'a> {
reference: NaiveDate,
discount: &'a Curve,
rungs: &'a [Rung],
recovery: Option<f64>,
fixings: &'a FixingStore,
fx: &'a FxRates,
tolerance: Tolerance,
day_count: DayCountFraction,
}Expand description
What a credit ladder was solved against — the part of its inputs its read back needs, whichever family it solved.
Fields§
§reference: NaiveDate§discount: &'a Curve§rungs: &'a [Rung]§recovery: Option<f64>§fixings: &'a FixingStore§fx: &'a FxRates§tolerance: Tolerance§day_count: DayCountFractionImplementations§
§impl CreditLadder<'_>
impl CreditLadder<'_>
fn solve_pillars(
&self,
build: impl Fn(&[f64]) -> Result<Survival, CalibrationError>,
) -> Result<(Vec<f64>, Vec<PillarSolve>), CalibrationError>
fn solve_pillars( &self, build: impl Fn(&[f64]) -> Result<Survival, CalibrationError>, ) -> Result<(Vec<f64>, Vec<PillarSolve>), CalibrationError>
The pillars solved one by one, each from the one before, on the curve
build makes of the per-pillar parameters — the hazard or the density
ladder, one body. A contract pillared on its maturity reads almost
nothing past it, so one pass nearly solves the ladder; but a weekend
maturity’s last coupon is observed the day before its Monday payment,
a day into the next segment, so solving that segment moves the rung
behind it. The pass therefore sweeps again, each pillar from its solved
value, until a sweep takes no step — or max_sweeps is spent.
fn read_back(
&self,
storage: &Survival,
params: &[f64],
family: SurvivalFamily,
) -> Result<(Provenance, Arc<SurvivalRefit>), CalibrationError>
fn read_back( &self, storage: &Survival, params: &[f64], family: SurvivalFamily, ) -> Result<(Provenance, Arc<SurvivalRefit>), CalibrationError>
The solved curve’s ladder and refit: every rung read back and
differentiated at the solution over params, checked as a rate
ladder is, and inverted into parameter per unit quote.