Multivariate effective sample size (mESS) of Markov chain in Python
Compute the multivariate effective sample size (mESS) of a Markov chain,
using the multivariate dependence structure of the process.
This is a Python implementation of the MATLAB implementation by Luigi
Acerbi of the mESS estimation method described in Vats et al. (2015).
The MATLAB code (and consequently this one) has some minor tweaks for the
choice of batch size b for the computation of the Monte Carlo covariance
matrix.
See the R package mcmcse for a separate implementation.
Disclaimer: This is a stripped down version of the original MATLAB code.
Most notably it does neither accept nor return the Monte Carlo covariance
matrix and does not return the batch size. It also processes one chain at a
time.
The effective sample size of a Markov chain is the size of an i.i.d. sample
with the same covariance structure as the current chain.
mESS is given by
mESS = n |Λ|^{1/p}/ |Σ|^{1/p}
where n is the current sample size, Λ is the sample covariance matrix,
p is the number of parameters and Σ is an estimate of the Monte Carlo
covariance matrix for the Markov chain (here obtained by batch estimation).