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:
dim_sample (int) – Sample size
weights (ndarray[np.float64, ndim=1]) – Weights of the samples Array shape: (dim_sample)
- Returns:
n_eff – Effecfive sample size
- Return type:
double