Checks convergence, mixing, effective sample size, and divergent transitions
$new(fit, pars)
Runs diagnostics on the supplied stanfit
object, restricted to parameters identified by the character vector
pars
.
Tests include:
Share of specified parameters with an Rhat less than 1.1. If any
have an Rhat > 1.1, everything_looks_fine
is set to FALSE
.
Share of specified parameters with an n_eff at least 0.1% of the
total number of posterior draws. If any have n_eff < 0.001 * N,
everything_looks_fine
is set to FALSE
.
Share of specified parameters with an n_eff of at least 100. If any
have n_eff < 100, everything_looks_fine
is set to FALSE
.
Number of divergent transitions during posterior sampling. If there
are any whatsoever, everything_looks_fine
is set to
FALSE
.
Share of posterior iterations where the sampler reached the
maximum treedepth. If more than 25\
everything_looks_fine
is set to FALSE
.
everything_looks_fine
logical indicating whether all MCMC tests passed.
diagnostics
list of the outcome of each MCMC test
warnings
list of the warning messages from failed MCMC tests
new()
Initialize a new mcmcChecks object and run diagnostics
mcmcChecks$new(fit, pars)
fit
A stanfit object to check
pars
A character vector of parameter names to check
clone()
The objects of this class are cloneable with this method.
mcmcChecks$clone(deep = FALSE)
deep
Whether to make a deep clone.