Resampling.Particles
A Particles
module exposes primitives available to resampling algorithms.
fold
allows to fold on the current population of particles.
get_output p
is the output of the particle at the last yield
point. Returns None
if the particle has terminated. See the documentation for yield
in Smc_inference
.
val total : unit -> r
total ()
is the total mass of the current population.
val ess : unit -> r
ess ()
is the estimated sample size. Varies between 0
and the cardinality of the current population. Computed as \left(\sum_{i=1}^N w_i^2\right)^{-1}
, where N
is equal to size ()
and the w_i
are the normalized scores of each particle.