Plot posterior distributions for selected parameters. Posteriors can be represented as density plots or histograms.

# S4 method for class 'ubmsFit'
plot_posteriors(object, pars = NULL, density = FALSE, ...)

Arguments

object

A fitted model of class ubmsFit

pars

A character vector of parameter names to include in the plot Look at names(object@stanfit) for the complete list of possible parameter names. If NULL, posteriors are shown for all parameters in the model summary output

density

If TRUE, show posteriors as density plots (one per chain). If FALSE, show posteriors as histograms of samples from all chains combined

...

Arguments passed to ggplot2::stat_density for density plots, or ggplot2::geom_histogram for histograms. For example, you can supply argument bins to control the number of histogram bins

Value

A ggplot