Skip to main content

effective_risk_of

Function effective_risk_of 

fn effective_risk_of(
    bond: &CallableBond,
    market: &MarketContext,
    oas: f64,
) -> Result<LatticeMoments, PricingError>
Expand description

The callable’s LatticeMoments at a given OAS: one lattice build, one rollback, in second-order forward mode.

The OAS enters HullWhiteLattice::rollback as exp(−(αᵢ + oas)·Δtᵢ) — an additive shift of the short rate at every node — and the Hull-White fit absorbs a parallel curve shift into α the same way. So a shift of the OAS is a parallel shift of the curve to this model, and seeding the OAS gives the parallel-shift derivative exactly, with no bump and no second build.

Measured: pricing at OAS s and pricing on a curve shifted by s agree to ~1e-14, provided the curve’s pillars span the bond. Past the last pillar the curve extrapolates, and bumping pillars there is not a parallel shift at all — the seeded derivative stays well defined, but it will not agree with such a bump, and the curve is what wants fixing.

Takes the market rather than a resolved view, unlike [callable_oas] and [clean_price_at_oas] beside it. Those work in whatever mode the caller is already in; this one needs second-order forward mode specifically, so it does its own lifting rather than making every caller construct a Jet2 view to hand back.

§Errors

PricingError from the lattice build or the curve queries, and PricingError::UnsupportedForProduct when the market resolved no Hull-White parameters.