jexplore.tools.diagnostic#

Diagnostic tool for assessing the convergence of the MCMC sampling.

Functions#

gelman_rubin_statistic(samples[, ntemp])

Return square root of Gelman-Rubin statistic R.

auto_correlation_length(samples)

Return auto correlation length from emcee.

Module Contents#

gelman_rubin_statistic(samples, ntemp=1)[source]#

Return square root of Gelman-Rubin statistic R.

Assess the convergence by comparing the variance between the chains and the variance in the chains.

Parameters:

samples (array) – (nchain, dim, npoints) array with nchain

equal to nwalker if ntemp=1 (default) or nchain equal nwalker x ntemp. :param int ntemp: return R per temperature is ntemp > 1 :return: (ntemp, ndim) array of the statistic for each dimension (and temperature) :rtype: array

auto_correlation_length(samples)[source]#

Return auto correlation length from emcee.

Parameters:

samples (array) – (nchain, dim, npoints) array with nchain

equal to nwalker :return: :rtype: array