Skip to main content

calibrate_jointly

Function calibrate_jointly 

pub fn calibrate_jointly(
    reference: NaiveDate,
    curves: &[JointCurve],
    fixings: &FixingStore,
    fx: &FxRates,
    tolerance: Tolerance,
    scheme: Interpolation,
) -> Result<JointCalibration, CalibrationError>
Expand description

Solves several rate curves at once — each a JointCurve, its rungs’ pillars its nodes — by damped Newton on the stacked log discount factors.

The sequential solve (calibrate, then calibrate_with) needs an order in which each ladder depends on curves already solved; a discount curve quoted only through OIS/IBOR basis swaps and an IBOR curve quoted through IRS have none, since every rung reads both. Here every rung’s residual — its value less its target — and its gradient over every curve’s nodes come from one pricing-mode risk pass on a market holding all the trial curves, so the Jacobian’s off-diagonal blocks are the pricing mode’s own adjoints, never a finite difference. Each curve starts from the sequential solve where that succeeds, and flat at its first rung’s quote where it does not; a step is halved until the residual norm falls.

§Errors

CalibrationError::Malformed for a curve with no rungs, a role other than a discount or projection curve, or pillars that do not ascend; CalibrationError::FitNotConverged when the iteration budget runs out; CalibrationError::SingularJacobian when a Newton system is singular; a pricing failure as itself.