Skip to main content

importance_weights

Function importance_weights 

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

Compute unnormalized importance weights for a set of samples.

Given samples drawn from proposal(x), returns the importance weight target(x) / proposal(x) for each sample.