Function calibrate_base_correlation
pub fn calibrate_base_correlation(
discount: &Curve,
survival: &Survival,
recovery: Option<f64>,
tranches: &[CdoTranche],
tolerance: Tolerance,
) -> Result<CalibratedBaseCorrelation, CalibrationError>Expand description
Calibrates a base-correlation curve to a contiguous capital structure of CDO tranches on one index — the market-standard bootstrap.
The quotes are the tranches. Each carries its running coupon and its
upfront, so at the solved correlation its value is zero; the residual is
its npv, as for a par rung. The structure must attach
at zero and be contiguous — each tranche attaching where the previous
detaches, detachments strictly increasing — because a base correlation is
defined on the cumulative tranche [0, D], and the mezzanine [A, D] is
priced as the difference of two of them, the lower already solved.
Each detachment is solved by a bracketed bisection on [0, 1), passive
throughout: correlation is never lifted (the model takes rho: f64), so
no derivative is available and none is needed — the equity expected loss
is monotone in its correlation, the bracket is fixed, and fifty halvings
reach the step tolerance. The direction of monotonicity is read off the
bracket’s ends, not assumed, so a seller’s tranche solves the same way.
recovery is the index’s market recovery; a tranche whose contract fixes
its own uses that, and one that needs the market’s and finds None is
refused by name before any solve. The discount and survival curves are the
index’s, lifted passive.
§Errors
CalibrationError::Malformed for an empty or non-contiguous structure or
a missing recovery; CalibrationError::NoCorrelation for a tranche no
correlation in [0, 1) reprices; CalibrationError::NoConvergence if a
bracketed solve does not settle; a valuation error otherwise.