Calculate and plot the Monte Carlo error of the samples from a JointAI model
MC_error(x, subset = "main", start = NULL, end = NULL, thin = NULL,
digits = 2, ...)# S3 method for MCElist
plot(x, scaled = TRUE, plotpars = NULL,
ablinepars = list(v = 0.05), ...)
object inheriting from class JointAI
subset of monitored parameters (columns in the MCMC sample).
Can be specified as a numeric vector of columns, a vector of
column names, as subset = "main"
or NULL
.
If NULL
, all monitored nodes will be plotted.
subset = "main"
(default) the main parameters of the
analysis model will be plotted (regression coefficients/fixed
effects, and, if available, standard deviation of the residual
and random effects covariance matrix).
the first iteration of interest (see window.mcmc
)
the last iteration of interest (see window.mcmc
)
thinning interval (see window.mcmc
)
number of digits for output
Arguments passed on to mcmcse::mcse.mat
the batch size. The default value is
“sqroot
”, which uses the square root of the
sample size. “cuberoot
” will cause the
function to use the cube root of the sample size. A
numeric value may be provided if neither
“sqroot
” nor “cuberoot
” is
satisfactory.
a function such that \(E(g(x))\) is the
quantity of interest. The default is NULL
, which
causes the identity function to be used.
the method used to compute the standard
error. This is one of “bm
” (batch means,
the default), “obm
” (overlapping batch
means), “tukey
” (spectral variance method
with a Tukey-Hanning window), or “bartlett
”
(spectral variance method with a Bartlett window).
use the scaled or unscaled version, default is TRUE
optional; list of parameters passed to plot()
optional; list of parameters passed to abline()
an object of class MCElist
with elements unscaled
,
scaled
and digits
. The first two are matrices with
columns est
(posterior mean), MCSE
(Monte Carlo error),
SD
(posterior standard deviation) and MCSE/SD
(Monte Carlo error divided by post. standard deviation.)
plot
: plot Monte Carlo error
Lesaffre, E., & Lawson, A. B. (2012). Bayesian Biostatistics. John Wiley & Sons.
# NOT RUN {
mod <- lm_imp(y~C1 + C2 + M2, data = wideDF, n.iter = 100)
MC_error(mod)
# }
Run the code above in your browser using DataLab