Function hull_white::bond_price_now

source ·
pub fn bond_price_now(
    bond_maturity: f64,
    yield_curve: &dyn Fn(f64) -> f64
) -> f64
Expand description

Returns price of a zero coupon bond at current date

Examples

let bond_maturity = 2.0;
let yield_curve = |t:f64|0.05*t; //yield curve returns the "raw" yield (not divided by maturity)
let bond_price = hull_white::bond_price_now(
    bond_maturity,
    &yield_curve
);