Learn R Programming

rater (version 1.3.2)

mcmc_diagnostics: 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"))

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.

Arguments

fit

An rater mcmc_fit object.

pars

A character vector of parameter names to return. By default c("pi", "theta").

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.

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

Run this code
# \donttest{

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")

# }

Run the code above in your browser using DataLab