Create density plots of posterior distributions with optional prior and
observed-data overlays. Returns a ggplot2 object that can be modified
with standard ggplot2 syntax.
density_plot(
object,
parameter = NULL,
show_prior = FALSE,
show_data = FALSE,
ndraws = 100,
prior_ndraws = 100,
alpha_levels = list(posterior = 0.8, prior = 0.6, data = 1),
colours = list(posterior = "#1F78B4", prior = "#E31A1C", data = "#000000"),
seed = NULL,
verbose = TRUE
)A ggplot2 object.
A qbrms_fit object.
Parameter name to plot. If NULL, plots the response distribution.
Logical; if TRUE, overlay the prior density.
Logical; if TRUE, overlay the observed data density.
Number of posterior draws to use (default 100).
Number of prior draws to use (default 100).
Named list controlling transparency for layers.
Named list of colours for layers.
Optional random seed.
Logical; print progress messages.