Skip to main content

self_normalized_is

Function self_normalized_is 

Source
pub fn self_normalized_is(
    samples: &[f64],
    h: impl Fn(f64) -> f64,
    target: impl Fn(f64) -> f64,
    proposal: impl Fn(f64) -> f64,
) -> f64
Expand description

Self-normalized importance sampling estimator for E_target\[h(X)\].

Samples are drawn from proposal; returns the weighted mean of h.