ESS function

Compute effective sample size of weighted sample