mcmcChecks {imt} | R Documentation |
MCMC Checks
Description
Checks convergence, mixing, effective sample size, and divergent transitions
Methods
$new(fit, pars)
Runs diagnostics on the supplied
stanfit
object, restricted to parameters identified by the character vectorpars
.
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 toFALSE
.
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 toFALSE
.
Share of specified parameters with an n_eff of at least 100. If any have n_eff < 100,everything_looks_fine
is set toFALSE
.
Number of divergent transitions during posterior sampling. If there are any whatsoever,everything_looks_fine
is set toFALSE
.
Share of posterior iterations where the sampler reached the maximum treedepth. If more than 25\everything_looks_fine
is set toFALSE
.
Active bindings
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
Methods
Public methods
Method new()
Initialize a new mcmcChecks object and run diagnostics
Usage
mcmcChecks$new(fit, pars)
Arguments
fit
A stanfit object to check
pars
A character vector of parameter names to check
Method clone()
The objects of this class are cloneable with this method.
Usage
mcmcChecks$clone(deep = FALSE)
Arguments
deep
Whether to make a deep clone.