# Can effective sample size in MCMC simulation be greater than the actual sample size?

I used coda package's effectiveSize() to find the effective sample size of my MCMC simulation. My effective sample size is greater than the actual sample size, e.g. 9813.626 greater than 9501. I wonder if that makes sense?

My understanding is that the effective sample size cannot be greater than the actual sample size, and will be smaller when there is more autocorrelation.

## 2 Answers

For a particular definition of autocorrelation, negative autocorrelation can cause $N_{eff} > n$. This answer gives a MWE using coda.

In principle yes, you are right. The sample size should not be larger.

• One possibility is that the package is using some optimization routine to improve the variance such as VEGAS.

• As kjetil b halvorsen pointed out, it could be that autocorrelation is negative. But I'm not seeing how.

• well, in principle, with negative autocorrelations, the effective sample size could be larger than the actual sample size. But I doubt that is likely to happen in practice! But your hard statement that it is impossible is untrue! – kjetil b halvorsen Mar 28 '14 at 19:39
• You are right @kjetilbhalvorsen, I didn't even thought about that. Any sane situation where this would happen? – Jorge Leitao Mar 28 '14 at 20:01