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
orplot.default
(seepar()
)
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
.
Examples
check(samples_LNR)
#> Iterations:
#> preburn burn adapt sample
#> [1,] 0 0 0 50
#> [2,] 0 0 0 50
#> [3,] 0 0 0 50
#>
#> mu
#> m m_lMd s t0
#> Rhat 0.996 1.004 1.022 1.026
#> ESS 152.000 150.000 196.000 160.000
#>
#> sigma2
#> m m_lMd s t0
#> Rhat 1.176 1.014 0.989 1.002
#> ESS 108.000 188.000 161.000 150.000
#>
#> alpha highest Rhat : bl1t
#> m m_lMd s t0
#> Rhat 1.01 1.041 1.02 1.022
#> ESS 198.00 150.000 177.00 150.000