Skip to contents

Generates density plots for the posterior distributions of a set of parameters from a fitted model within a bipod object. Optionally overlays histograms on the density plots.

Usage

plot_posteriors(
  x,
  x_fit,
  par_list,
  with_histogram = F,
  alpha = 0.6,
  colors = NULL
)

Arguments

x

A bipod object of class bipod. Must contain a 'fit' field and should have been fitted with model selection.

x_fit

The fit object within x that contains the desired parameters.

par_list

A character vector containing the names of the parameters whose posterior distributions are to be plotted.

with_histogram

A logical value indicating whether to overlay histograms of the posterior samples on the density plots. (default is FALSE)

alpha

A numeric value between 0 and 1 specifying the transparency level of the density plots. (default is .6)

colors

A character vector specifying the colors to use for the density plots of each parameter. If NULL, a default color scheme will be used. (default is NULL)

Value

A ggplot2 object showing the density plots of the specified parameters. If with_histogram is TRUE, histograms will be overlaid on the density plots.