Skip to main content

moments

Function moments 

fn moments(
    bond: &FixedRateBond,
    y: f64,
    settlement: NaiveDate,
    basis: YieldBasis,
) -> (f64, f64, f64)
Expand description

The price moments at y: (P, P′, P″), taken by the mode.

Seeds the yield in second-order forward mode and prices once. The derivatives are the pricing body’s own, which is the point: a duration formula written out separately is a second statement of the same maths, and the two drift.