plot_priors_vs_posts: Make a grid of posterior plots with priors and initial values

View source: R/plot-priors-vs-posts.R

plot_priors_vs_postsR Documentation

Make a grid of posterior plots with priors and initial values

Description

Make a grid of posterior plots with priors and initial values

Usage

plot_priors_vs_posts(
  model,
  x_range = c("posterior", "prior"),
  median_line_color = "darkred",
  initial_value_color = "green",
  prior_line_color = "black",
  facet_title_font_size = axis_title_font_size,
  ...
)

Arguments

model

The model output from Stock Synthesis as loaded by create_rds_file().

x_range

A string specifying the method to limit the range of each x axis in the panels. Typically, all geoms used in the figure dictate the range. But, with the use of ggh4x::facetted_pos_scales() we can specify which data set should specify the range limits. Setting this argument to "posterior", instead of the default "prior", will limit the ranges to only the realized values in the posterior. This can be helpful when the prior is quite vague and the posterior only covers a small range of the parameter space.

median_line_color

The color to use for the vertical median lines

initial_value_color

The color to use for the initial value points

prior_line_color

The color to use for the density lines representing the prior distributions

facet_title_font_size

The font size to use for the panel titles (the parameter names at the top of each plot)

...

Parameters to be passed to ggplot2::facet_wrap(). For example, labeller = label_parsed_space, which is available in this package, will remove the spaces from the strings and implement ggplot2::label_parsed(). And, ncol and nrow can be used to direct the output or you can let ggplot2 figure it out.

Value

A ggplot2 object.


pacific-hake/hake-assessment documentation built on Jan. 14, 2025, 9:12 p.m.