# fit a JointAI model
mod <- lm_imp(y ~ C1 + C2 + M1, data = wideDF, n.iter = 100)
# 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 ggplot syntax)
library(ggplot2)
traceplot(mod, use_ggplot = TRUE) +
theme(legend.position = 'bottom') +
xlab('iteration') +
ylab('value') +
scale_color_discrete(name = 'chain')
Run the code above in your browser using DataLab