Check the convergence diagnostics on a model.




A wide data frame of posterior samples returned by hb_mcmc_hierarchical() or similar MCMC function.


A data frame of summarized convergence diagnostics. max_rhat is the maximum univariate Gelman/Rubin potential scale reduction factor over all the parameters of the model, min_ess_bulk is the minimum bulk effective sample size over the parameters, and min_ess_tail is the minimum tail effective sample size. max_rhat should be below 1.01, and the ESS metrics should both be above 100 times the number of MCMC chains. If any of these conditions are not true, the MCMC did not converge, and it is recommended to try running the model for more saved iterations (and if max_rhat is high, possibly more warmup iterations).


data <- hb_sim_pool(n_continuous = 2)$data
mcmc <- hb_mcmc_pool(
  n_chains = 1,
  n_adapt = 100,
  n_warmup = 200,
  n_iterations = 200
#> # A tibble: 1 × 3
#>   max_rhat min_ess_bulk min_ess_tail
#>      <dbl>        <dbl>        <dbl>
#> 1     1.05         134.         56.6