Calculates the Gelman-Rubin criterion for convergence
gelman.diag from package coda).
GR_crit(object, confidence = 0.95, transform = FALSE, autoburnin = TRUE, multivariate = TRUE, subset = NULL, exclude_chains = NULL, start = NULL, end = NULL, thin = NULL, warn = TRUE, mess = TRUE, ...)
object inheriting from class 'JointAI'
the coverage probability of the confidence interval for the potential scale reduction factor
a logical flag indicating whether variables in
x should be transformed to improve the normality of the
distribution. If set to TRUE, a log transform or logit transform, as
appropriate, will be applied.
a logical flag indicating whether only the second half
of the series should be used in the computation. If set to TRUE
start(x) is less than
end(x)/2 then start
of series will be adjusted so that only second half of series is used.
a logical flag indicating whether the multivariate potential scale reduction factor should be calculated for multivariate chains
subset of parameters/variables/nodes (columns in the MCMC
sample). Follows the same principle as the argument
optional vector of the index numbers of chains that should be excluded
the first iteration of interest
the last iteration of interest
thinning interval (integer; see
thin = 1 (default) will keep the MCMC samples
from all iterations;
thin = 5 would only keep every 5th
logical; should warnings be given? Default is
logical; should messages be given? Default is
currently not used
Gelman, A and Rubin, DB (1992) Inference from iterative simulation using multiple sequences, Statistical Science, 7, 457-511.
Brooks, SP. and Gelman, A. (1998) General methods for monitoring convergence of iterative simulations. Journal of Computational and Graphical Statistics, 7, 434-455.
contains some examples how to specify the argument
mod1 <- lm_imp(y ~ C1 + C2 + M2, data = wideDF, n.iter = 100) GR_crit(mod1) #> Potential scale reduction factors: #> #> Point est. Upper C.I. #> (Intercept) 1.006 1.03 #> C1 1.007 1.04 #> C2 1.003 1.02 #> M22 1.004 1.02 #> M23 1.015 1.06 #> M24 1.010 1.05 #> sigma_y 0.998 1.00 #> #> Multivariate psrf #> #> 1.02