Function hull_white::caplet_now

source ·
pub fn caplet_now(
    a: f64,
    sigma: f64,
    option_maturity: f64,
    delta: f64,
    strike: f64,
    yield_curve: &dyn Fn(f64) -> f64
) -> f64
Expand description

Returns price of a caplet at current time

Examples

let a = 0.2; //speed of mean reversion for underlying Hull White process
let sigma = 0.3; //volatility of underlying Hull White process
let option_maturity = 1.5;
let delta = 0.25; //delta is the tenor of the Libor rate
let strike = 0.04;
let yield_curve = |t:f64|0.05*t; //yield curve returns the "raw" yield (not divided by maturity)
let caplet = hull_white::caplet_now(
    a, sigma,  
    option_maturity, delta,
    strike,
    &yield_curve
);