Creates a set of traceplots from the MCMC sample of an object of class "JointAI".

traceplot(object, ...)

# S3 method for mcmc.list
traceplot(object, start = NULL, end = NULL,
  thin = NULL, ...)

# S3 method for JointAI
traceplot(object, start = NULL, end = NULL,
  thin = NULL, subset = c(analysis_main = TRUE), nrow = NULL,
  ncol = NULL, keep_aux = FALSE, use_ggplot = FALSE, warn = TRUE,
  mess = TRUE, ...)

Arguments

object

object inheriting from class 'JointAI'

...

Arguments passed on to graphics::matplot

lty

vector of line types, widths, and end styles. The first element is for the first column, the second element for the second column, etc., even if lines are not plotted for all columns. Line types will be used cyclically until all plots are drawn.

lwd

vector of line types, widths, and end styles. The first element is for the first column, the second element for the second column, etc., even if lines are not plotted for all columns. Line types will be used cyclically until all plots are drawn.

lend

vector of line types, widths, and end styles. The first element is for the first column, the second element for the second column, etc., even if lines are not plotted for all columns. Line types will be used cyclically until all plots are drawn.

col

vector of colors. Colors are used cyclically.

cex

vector of character expansion sizes, used cyclically. This works as a multiple of par("cex"). NULL is equivalent to 1.0.

bg

vector of background (fill) colors for the open plot symbols given by pch = 21:25 as in points. The default NA corresponds to the one of the underlying function plot.xy.

xlim

ranges of x and y axes, as in plot.

ylim

ranges of x and y axes, as in plot.

add

logical. If TRUE, plots are added to current one, using points and lines.

verbose

logical. If TRUE, write one line of what is done.

start

the first iteration of interest (see window.mcmc)

end

the last iteration of interest (see window.mcmc)

thin

thinning interval (see window.mcmc)

subset

subset of parameters/variables/nodes (columns in the MCMC sample). Uses the same logic as the argument monitor_params in lm_imp, glm_imp, clm_imp, lme_imp, glme_imp, survreg_imp and coxph_imp.

nrow

optional number of rows and columns in the plot layout; automatically chosen if unspecified

ncol

optional number of rows and columns in the plot layout; automatically chosen if unspecified

keep_aux

logical; Should constant effects of auxiliary variables be kept in the output?

use_ggplot

logical; Should ggplot be used instead of the base graphics?

warn

logical; should warnings be given? Default is TRUE. Note: this applies only to warnings given directly by JointAI.

mess

logical; should messages be given? Default is TRUE. Note: this applies only to messages given directly by JointAI.

See also

summary.JointAI, lme_imp, glm_imp, lm_imp, densplot The vignette Parameter Selection contains some examples how to specify the parameter subset.

Examples

# fit a JointAI model mod <- lm_imp(y~C1 + C2 + M2, data = wideDF, n.iter = 100)
#> This is new software. Please report any bugs to the package maintainer.
# Example 1: simple traceplot traceplot(mod)
# Example 2: ggplot version of traceplot traceplot(mod, use_ggplot = TRUE)
# Example 5: changing how the ggplot version looks (using standard ggplot syntax) library(ggplot2) traceplot(mod, use_ggplot = TRUE) + theme(legend.position = 'botto') + xlab('iteration') + ylab('value') + scale_color_discrete(name = 'chain')