| 1 | = PDAF_diag_effsample = |
| 2 | |
| 3 | This page documents the routine `PDAF_diag_effsample` of PDAF, which was introduced with PDAF V1.12. |
| 4 | |
| 5 | This routine computes the effective sample size of a particle filter as defined in Doucet et al. 2001 p. 333. |
| 6 | |
| 7 | The effective sample size is a diagnostic quantity used in particle filter. It is defined as the inverse of the sum of the squared particle filter weights: |
| 8 | {{{ |
| 9 | n_eff = 1 / (Sum_i=1,N w_i^2) |
| 10 | }}} |
| 11 | where `w_i` is the weight of particle with index i and `N` is the number of particles. If all weights are identical, it is `n_eff=N` and a particle file analysis step will have no influence. If `n_eff=1`, a single particle contains all weight, such that the sample of particle collapeses. |
| 12 | |
| 13 | The routine is typically called during the analysis step of a particle filter, e.g. in the analysis step of NETF and LNETF. |
| 14 | |
| 15 | The interface is the following: |
| 16 | {{{ |
| 17 | SUBROUTINE PDAF_diag_effsample(dim_sample, weights, n_eff) |
| 18 | }}} |
| 19 | with the following arguments: |
| 20 | * `dim_sample` : `integer, intent(in)`[[BR]] Number of particles |
| 21 | * `weights` : `real, intent(in), dimension(dim_sample)`[[BR]] Weights of the particles |
| 22 | * `n_eff` : `real, intent(out)`[[BR]] Effective sample size |