Function hull_white::mu_r

source ·
pub fn mu_r(
    r_t: f64,
    a: f64,
    sigma: f64,
    t: f64,
    t_m: f64,
    forward_curve: &dyn Fn(f64) -> f64
) -> f64
Expand description

Returns expectation of the interest rate process under the risk neutral measure.

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 taking the expectation
let t_m = 2.0; //horizon of the expectation
let forward_curve = |t:f64|t.ln();
let expected_value = hull_white::mu_r(
    r_t, a, sigma,
    t, t_m,
    &forward_curve
);