PlotGelmanRubinDiagnosticMultiChain {carbondate} | R Documentation |
Plot Histogram of the Gelman-Rubin Convergence Diagnostic for Multiple Independent MCMC Chains
Description
This plots a histogram of the potential scale reduction factors (PSRF) for each of the individual
posterior calendar age estimates for multiple independent MCMC chains. Achieved by comparing the
within-chain variance with the between-chains variance after n_burn
iterations.
The PSRF of each sample's posterior calendar age is calculated.
If the chain have converged to the target posterior distribution, then PSRF should
be close to 1 for all of the samples (a stringent condition is that all values are less than 1.1).
For more information read the vignette:
vignette("determining-convergence", package = "carbondate")
Usage
PlotGelmanRubinDiagnosticMultiChain(output_data_list, n_burn = NA)
Arguments
output_data_list |
A list, each item containing the return value from one of the updating functions e.g. PolyaUrnBivarDirichlet, WalkerBivarDirichlet or PPcalibrate. The minimum number of elements in the list is 2. |
n_burn |
The number of MCMC iterations that should be discarded for burn-in. This relates to
the total number of iterations |
Value
None
Examples
# Plot results for the example data - n_iter is too small for convergence
# Try increasing n_iter to see the values of the PSRF decrease
po <- list()
for (i in 1:3) {
set.seed(i)
po[[i]] <- PolyaUrnBivarDirichlet(
two_normals$c14_age,
two_normals$c14_sig,
intcal20,
n_iter=400,
show_progress = FALSE)
}
PlotGelmanRubinDiagnosticMultiChain(po)