Function bayes_estimate::estimators::sir::systematic_resampler[][src]

pub fn systematic_resampler(
    l: &mut Likelihoods,
    rng: &mut dyn RngCore
) -> Result<(Resamples, u32, f32), &'static str>
Expand description

Systematic resample algorithm from [2]. Algorithm: A particle is chosen once for each time its cumulative likelihood intersects with an equidistant grid. A uniform random draw is chosen to position the grid within the cumulative likelihoods. Complexity O(n)

Returns: number of times this particle should be resampled, number of unqiue particles (number of non zeros in resamples), conditioning of the likelihoods (min likelihood / sum likelihoods)

Side effects: ‘l’ becomes a normalised cumulative sum, Draws are made from ‘rng’ for each likelihood