effectiveSampleSize function

Compute the effective sample size (ESS) of the particles.