SedSat3 1.1.6
Sediment Source Apportionment Tool - Advanced statistical methods for environmental pollution research
Loading...
Searching...
No Matches
mcmcdiagnostics.h File Reference

Convergence diagnostics for MCMC chains: split R-hat and the effective sample size. More...

#include <vector>
#include <cmath>
#include <algorithm>
#include <limits>
#include <gsl/gsl_fft_complex.h>
Include dependency graph for mcmcdiagnostics.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  mcmcdiagnostics::Diagnostics

Namespaces

namespace  mcmcdiagnostics

Functions

std::vector< double > mcmcdiagnostics::Autocovariance (const std::vector< double > &x)
 Autocovariance of x at lags 0..n-1 (divided by n), computed with an FFT.
Diagnostics mcmcdiagnostics::Diagnose (const std::vector< std::vector< double > > &chains)
 Split R-hat and effective sample size of one quantity.

Detailed Description

Convergence diagnostics for MCMC chains: split R-hat and the effective sample size.

Both follow Vehtari, Gelman, Simpson, Carpenter and Bürkner (2021), "Rank-normalization, folding, and localization: an improved R-hat for assessing convergence of MCMC", Bayesian Analysis 16(2), without the rank normalization. Each chain is split in two halves, so a chain whose first and second halves differ (a trend) also shows as non-converged.

Definition in file mcmcdiagnostics.h.