Post date: Apr 24, 2014 10:52:8 PM
I added two MCMC diagnostics to estpost for entropy: effective sample size and Gelman & Rubin's potential scale reduction factor.
The effective sample size calculation is summed across chains and is based on the MCMC autocorrelation at different lags. The equation for ESS is:
ESS = N / (1 + 2 * sum_k autocorrelation_k(x))
where the sum is an infinite sum over all lags. I approximate this by taking the sum out to the lag where the autocorrelation drops to 0.01 (an R package suggested 0.05, so this is even better). I had to write my own autocorrelation function for lags greater than 1.
The Gelman & Rubin potential scale reduction factor is calculated following equation 11.3 (and related calculations) on page 296-297 of Bayesian Data Analysis (4th edition). Values close to 1 are consistent with convergence to the posterior distribution.