Obsidian
Probabilistic Geophysical Joint Inversion
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
stateline::mcmc::EpsrConvergenceCriteria Class Reference

Convergence test using estimated potential scale reduction (EPSR). It is a convergence metric that takes into account the variance of the means between chains and the variance of the samples within each chain. More...

#include <diagnostics.hpp>

Public Member Functions

 EpsrConvergenceCriteria (int numChains, int numDims)
 Initialise the convergence criteria. More...
 
void update (uint id, const Eigen::VectorXd &sample)
 Update the convergence statistics for a new sample in a particular chain. More...
 
Eigen::ArrayXd rHat () const
 Compute the estimated potential scale factor. A low value indicates that the chains are converging. More...
 
bool hasConverged () const
 Check if all the chains have converged. The chains have converged if the potential scale reduction factor is below 1.1 for all dimensions. More...
 

Detailed Description

Convergence test using estimated potential scale reduction (EPSR). It is a convergence metric that takes into account the variance of the means between chains and the variance of the samples within each chain.

Constructor & Destructor Documentation

stateline::mcmc::EpsrConvergenceCriteria::EpsrConvergenceCriteria ( int  numChains,
int  numDims 
)
inline

Initialise the convergence criteria.

Parameters
numChainsThe number of chains to be tested for convergence.
numDimsThe number of dimensions in each state.

Member Function Documentation

bool stateline::mcmc::EpsrConvergenceCriteria::hasConverged ( ) const
inline

Check if all the chains have converged. The chains have converged if the potential scale reduction factor is below 1.1 for all dimensions.

Returns
Whether all the chains have converged.
Eigen::ArrayXd stateline::mcmc::EpsrConvergenceCriteria::rHat ( ) const
inline

Compute the estimated potential scale factor. A low value indicates that the chains are converging.

Returns
A vector containing the scale factors for each dimension.
void stateline::mcmc::EpsrConvergenceCriteria::update ( uint  id,
const Eigen::VectorXd &  sample 
)
inline

Update the convergence statistics for a new sample in a particular chain.

Parameters
idThe chain which has the new sample.
sampleThe new sample to update the convergence statistics with.

The documentation for this class was generated from the following file: