pyPDAF.PDAF.diag_effsample

pyPDAF.PDAF.diag_effsample()

Calculating the effective sample size of a particle filter.

Based on [1], it is defined as the inverse of the sum of the squared particle filter weights: \(N_{eff} = \frac{1}{\sum_{i=1}^{N} w_i^2}\) where \(w_i\) is the weight of particle with index i. and \(N\) is the number of particles.

If the \(N_{eff}=N\), all weights are identical, and the filter has no influence on the analysis. If \(N_{eff}=0\), the filter is collapsed.

This is typically called during the analysis step of a particle filter, e.g. in the analysis step of NETF and LNETF.

References

Parameters:

weights (ndarray[tuple[dim_sample], np.float64]) –

weights of the particles

The array dimension dim_sample is Number of particles

Returns:

effSample – effecfive sample/particle size

Return type:

float