Skip to contents

Creates a visualization comparing the posterior distributions of growth rates across different groups. The distributions are normalized so their peaks align at 1.0, making it easier to compare their shapes and spreads. The plot can optionally include the prior distribution for reference.

Usage

plot_normalized_growth_rate_posteriors(
  x,
  add_prior = F,
  legend_labels = NULL,
  legend_title = "group",
  colors = NULL
)

Arguments

x

A bipod object containing a 'fit' field with model results

add_prior

Logical indicating whether to overlay the prior distribution on the plot. Defaults to FALSE

legend_labels

Character vector providing custom labels for each growth rate parameter. Must match the number of parameters. If NULL, uses rho_i format. Defaults to NULL

legend_title

Character string specifying the title for the plot legend. Defaults to "group"

colors

Character vector specifying colors for different growth rate distributions. If NULL, uses default color palette. Defaults to NULL

Value

A ggplot2 object showing the normalized posterior density plots

Details

The normalization process scales each distribution so its maximum density equals 1. This allows for easy comparison of distribution shapes regardless of their original scales. The prior distribution, if included, is also normalized in the same way.