View source: R/mcmc_diagnostics.R
mcmc_diagnostics | R Documentation |
Retrieve MCMC convergence diagnostics for a rater fit
mcmc_diagnostics(fit, pars = c("pi", "theta"))
fit |
An rater |
pars |
A character vector of parameter names to return. By default
|
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.
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.
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
.
rstan::Rhat()
, rstan::ess_bulk()
as_mcmc.list()
,
get_stanfit()
.
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")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.