Computes per-parameter effective sample size (ESS) and, when multiple runs are available, the upper limit of the Gelman-Rubin potential scale reduction factor (R-hat), using the coda package.
Arguments
- treeppl_out
A tibble produced by
tp_parse_mcmc(), with columnsrun,iteration,parameter, andsamples. The input must have aparametercolumn; output produced from an unnamed TreePPL return type is not supported and will raise an error, since there is no reliable way to distinguish multiple parameters.
Value
A tibble with one row per parameter, containing:
- parameter
Parameter name.
- ess
Effective sample size, pooled across all runs.
- rhat_upper
Upper limit of the Gelman-Rubin R-hat statistic. Only computed when
treeppl_outcontains more than one run; otherwiseNA, with a message explaining why.
Examples
if (FALSE) { # \dontrun{
d <- tp_parse_mcmc(mod_mcmc)
tp_mcmc_convergence(d)
} # }