Effective sample size larger than number of samples for NUTS

Hello everyone,

In my current application the effective sample size, obtained via arviz.ess is larger than the actual number of samples when sampling with NUTS. I do not complain at all, but I’d like to be able to explain this properly.

I couldn’t find any information in the pymc3 docs. In the Stan docs they mention that this behavior can occur for “negative autocorrelations on odd lags” and that in Stan it can happen with NUTS and “parameters which have close to Gaussian posterior and little dependency on other parameters”. Now I have several questions:

Most importantly: Is this only some theoretical effect caused by the definition of ess, or are my samples in fact as powerful as an even larger number of uncorrelated samples?

Also: Why would the odd lags need to be negatively autocorrelated? Looking at the formula for ess any negative autocorrelation would cause this effect.

Finally: Can this happen for Metropolis-Hastings too, or only for NUTS?

Thanks in advance for clearing this up.


1 Like

There is a bit more background here: https://statmodeling.stat.columbia.edu/2018/01/18/measuring-speed-stan-incorrectly-faster-thought-cases-due-antithetical-sampling/