MC_error.Rd
Calculate and plot the Monte Carlo error of the samples from a JointAI model.
MC_error(x, subset = NULL, start = NULL, end = NULL, thin = NULL, digits = 2, warn = TRUE, mess = TRUE, ...) # S3 method for MCElist plot(x, data_scale = TRUE, plotpars = NULL, ablinepars = list(v = 0.05), ...)
x  object inheriting from class 'JointAI' 

subset  subset of parameters/variables/nodes (columns in the MCMC sample).
Uses the same logic as the argument 
start  the first iteration of interest (see 
end  the last iteration of interest (see 
thin  thinning interval (see 
digits  number of digits for output 
warn  logical; should warnings be given? Default is

mess  logical; should messages be given? Default is

...  Arguments passed on to

data_scale  show the Monte Carlo error of the sample transformed back
to the scale of the data ( 
plotpars  optional; list of parameters passed to 
ablinepars  optional; list of parameters passed to 
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 & Lawson (2012) [p. 195] suggest the Monte Carlo error of a parameter should not be more than 5% of the posterior standard deviation of this parameter (i.e., \(MCSE/SD \le 0.05\)).
Lesaffre, E., & Lawson, A. B. (2012). Bayesian Biostatistics. John Wiley & Sons.
The vignette Parameter Selection
contains some examples how to specify the argument subset
.
#>MC_error(mod)#> est MCSE SD MCSE/SD #> (Intercept) 35.99 1.352 26.07 0.052 #> C1 27.15 0.937 18.20 0.051 #> C2 0.90 0.043 0.69 0.062 #> M22 0.35 0.071 0.59 0.122 #> M23 0.15 0.077 0.63 0.123 #> M24 1.09 0.064 0.56 0.113 #> sigma_y 2.22 0.012 0.16 0.075