check: Convergence Checks for an emc Object

View source: R/s3_funcs.R

check.emcR Documentation

Convergence Checks for an emc Object

Description

Runs a series of convergence checks, prints statistics to the console, and makes traceplots of the worst converged parameter per selection.

Usage

## S3 method for class 'emc'
check(
  emc,
  selection = c("mu", "sigma2", "alpha"),
  digits = 3,
  plot_worst = TRUE,
  ...
)

check(emc, ...)

Arguments

emc

An emc object

selection

A Character vector. Indicates which parameter types to check (e.g., alpha, mu, sigma2, correlation).

digits

Integer. How many digits to round the ESS and Rhat to in the plots

plot_worst

Boolean. If TRUE also plots the chain plots for the worst parameter

...

Optional arguments that can be passed to get_pars or plot.default (see par())

Details

Note that the Rhat is calculated by doubling the number of chains by first splitting chains into first and second half, so it also a test of stationarity.

Efficiency of sampling is indicated by the effective sample size (ESS) (from the coda R package). Full range of possible samples manipulations described in get_pars.

Value

a list with the statistics for the worst converged parameter per selection

Examples

check(samples_LNR)

EMC2 documentation built on April 11, 2025, 5:50 p.m.