mcmc_diagnostics {rater} | R Documentation |
Retrieve MCMC convergence diagnostics for a rater fit
Description
Retrieve MCMC convergence diagnostics for a rater fit
Usage
mcmc_diagnostics(fit, pars = c("pi", "theta"))
Arguments
fit |
An rater |
pars |
A character vector of parameter names to return. By default
|
Details
MCMC diagnostics cannot be calculate for the z due to the marginalisation used to fit the models.
These MCMC diagnostics are intended as basic sanity check of the quality
of the MCMC samples returned. Users who want more in depth diagnostics
should consider using as_mcmc.list()
to convert the samples to a
coda::mcmc.list()
object, or get_stanfit()
to extract the underlying
stanfit object.
Value
A matrix where the columns represent different diagnostics and the rows are different parameters. Currently the first column contains the Rhat statistic and the second bulk effective samples size. The rownames contain the parameter names.
References
Aki Vehtari, Andrew Gelman, Daniel Simpson, Bob Carpenter, and
Paul-Christian Bürkner (2019). Rank-normalization, folding, and
localization: An improved R-hat for assessing convergence of
MCMC. arXiv preprint arXiv:1903.08008
.
See Also
rstan::Rhat()
, rstan::ess_bulk()
as_mcmc.list()
,
get_stanfit()
.
Examples
fit <- rater(anesthesia, "dawid_skene")
# Calculate the diagnostics for all parameters.
mcmc_diagnostics(fit)
# Calculate the diagnostics just for the pi parameter.
mcmc_diagnostics(fit, pars = "pi")