Skip to main content

macaulay_duration

Function macaulay_duration 

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

Macaulay duration: the PV-weighted mean time to the bond’s remaining flows.

See pv_weighted_time for why this is a seeded derivative rather than a conversion of modified_duration.