Function strip_caplet_vols
pub fn strip_caplet_vols(
index: &IborIndex,
effective: NaiveDate,
quotes: &[CapQuote],
strike: Option<f64>,
first_caplet_excluded: bool,
scheme: StripScheme,
convention: VolConvention,
market: &MarketContext,
tolerance: Tolerance,
) -> Result<RateVolSurface, PricingError>Expand description
Caplet vols from term cap quotes: the surface under which every quoted cap reprices, exactly, at its own strike.
A term cap is quoted as one flat vol for all its caplets, but the caplets
of a longer cap are priced beside those of a shorter one, and the two
quotes cannot both be each caplet’s vol. The strip holds the caplet vol
constant between consecutive cap maturities and solves each interval’s
vol so that the cap ending there reprices its quote, given the intervals
before it. Here each cap is struck at strike,
or at its own at-the-money rate when none is given — as at-the-money
caps are quoted — and priced under the stripped vols at that strike, so
the solve is on the cap’s whole value, not on an incremental price that
a per-cap strike would make meaningless.
The surface returned carries one expiry node per caplet fixing, each at its interval’s vol, on the index tenor; a cap priced off it reads every node exactly, which is what makes the repricing exact rather than interpolated.
first_caplet_excluded builds each cap as the market quotes it — without
the first caplet, whose rate is fixed at trade — which is what a term cap
vol refers to; false strips the whole strip.
§Errors
UnsupportedForProduct if the quotes are not ascending, the caps’
schedules do not nest, or a cap has no caplet left to strip;
UnbracketedSolve when a quote is below the intrinsic the earlier
intervals already imply — the quotes admit arbitrage; otherwise whatever
resolution or the pricer reports.