Template Function beluga::effective_sample_size

Function Documentation

template<class Range, std::enable_if_t<!is_particle_range_v<Range>, int> = 0>
auto beluga::effective_sample_size(Range &&range)

Calculate the ESS of a given a range of weights.

Overload for particle ranges.

The effective sample size (ESS) is a figure of merit for importance sampling methods’ output. It characterizes how well the target posterior distribution is approximated (as it is proportional to the efficiency of distribution parameter estimators, kong1994sequentialimputations, section 4.1). It can be interpreted as the number of samples effectively approximating the distribution, and thus comparing with the total number of samples makes for a good mechanism to detect and react to performance degradation e.g. triggering a resample when the ESS falls below a fraction of the total number of samples.

The algorithm is based on grisetti2007selectiveresampling, according to the description given in tiacheng2015resamplingmethods.

Template Parameters:

Range – A forward range.

Parameters:

range – The range of weights.