[−][src]Function hull_white::coupon_bond_put_t
pub fn coupon_bond_put_t(
r_t: f64,
a: f64,
sigma: f64,
t: f64,
option_maturity: f64,
coupon_times: &[f64],
bond_maturity: f64,
coupon_rate: f64,
strike: f64,
yield_curve: &dyn Fn(f64) -> f64,
forward_curve: &dyn Fn(f64) -> f64
) -> f64
Returns price of a put option on a coupon bond at some future time
Examples
let r_t = 0.04; //current rate let a = 0.2; //speed of mean reversion for underlying Hull White process let sigma = 0.3; //volatility of underlying Hull White process let t = 1.0; //time from "now" (0) to start valuing the bond let option_maturity = 1.5; let coupon_times = vec![1.25, 1.5, 1.75, 2.0, 2.5]; let bond_maturity = 3.0; let strike = 1.0; let coupon_rate = 0.05; let yield_curve = |t:f64|0.05*t; //yield curve returns the "raw" yield (not divided by maturity) let forward_curve = |t:f64|t.ln(); let put_price = hull_white::coupon_bond_put_t( r_t, a, sigma, t, option_maturity, &coupon_times, bond_maturity, coupon_rate, strike, &yield_curve, &forward_curve );