Skip to main content

calibrate_sabr

Function calibrate_sabr 

pub fn calibrate_sabr(
    grid: &RateVolSurface,
    forwards: &[Vec<f64>],
    spec: &SabrSpec,
) -> Result<SabrFit, SabrCalibrationError>
Expand description

Fits SABR to every (expiry, tenor) node of the smiled grid, each slice at its forward — forwards[expiry][tenor], one row per grid expiry and one value per grid tenor. A slice whose grid quotes the forward itself holds σ_ATM at that quote; any other fits it with ρ and ν.

A slice that meets no acceptance bound within its restarts is still returned, at its best fit, with SabrSliceFit::accepted false: the caller reads the diagnostics and decides.

§Errors

SabrCalibrationError::Grid for a grid without a strike axis, forwards not shaped like the grid, or a quote that cannot be restated in the spec’s convention; SabrCalibrationError::Slice for a slice with fewer quotes than free parameters, or one with no start the expansion reads.