ess function

Effective sample size (ESS)