Learn R Programming

brms (version 0.9.1)

plot.brmsfit: Trace and Density Plots for MCMC Samples

Description

Trace and Density Plots for MCMC Samples

Usage

## S3 method for class 'brmsfit':
plot(x, pars = NA, parameters = NA, N = 5,
  theme = ggplot2::theme(), ask = TRUE, do_plot = TRUE, newpage = TRUE,
  ...)

Arguments

x
An object of class brmsfit.
pars
Names of the parameters to plot, as given by a character vector or a regular expression. By default, all parameters except for random effects are plotted.
parameters
A deprecated alias of pars
N
The number of parameters plotted per page.
theme
A theme object modifying the appearance of the plots. For some basic themes see ggtheme. Can be defined globally for the curr
ask
logical; indicates if the user is prompted before a new page is plotted. Only used if do_plot is TRUE.
do_plot
logical; indicates if plots should be plotted directly in the active graphic device. Defaults to TRUE.
newpage
logical; indicates if the first set of plots should be plotted to a new page. Only used if do_plot is TRUE.
...
Further arguments passed to arrangeGrob.

Value

  • A (possibly invisible) list of gtable objects.

Examples

Run this code
fit <- brm(count ~ log_Age_c + log_Base4_c * Trt_c 
           + (1|patient) + (1|visit), 
           data = epilepsy, family = "poisson")
## plot fixed effects as well as standard devations of the random effects
plot(fit)
## plot fixed effects only
plot(fit, pars = "^b_")

Run the code above in your browser using DataLab