Skip to main content

mc_control_variate

Function mc_control_variate 

Source
pub fn mc_control_variate(
    f: impl Fn(f64) -> f64,
    g: impl Fn(f64) -> f64,
    g_mean: f64,
    a: f64,
    b: f64,
    n: usize,
    rng: &mut Lcg,
) -> f64
Expand description

Control-variate Monte Carlo estimator.

Estimates E\[f(X)\] using control variate g whose mean E\[g(X)\] is known.

Returns the reduced-variance estimate.