Skip to contents

Plot the spawning biomass (tonnes) or relative spawning biomass by year for a single model run, a grid of model runs, or an MCMC.

Usage

plot_biomass_spawning(
  data_list,
  object_list,
  posterior = NULL,
  probs = c(0.025, 0.975),
  relative = TRUE,
  labels = NULL
)

Arguments

data_list

A list or list of lists containing the data that was passed to MakeADFun. For multiple models, provide a list of data objects.

object_list

A list or list of lists specifying the AD object(s) created using MakeADFun. For multiple models, provide a list of objects.

posterior

An rstan object created using the tmbstan function for Bayesian inference. Default is NULL.

probs

A numeric vector of length 2 with probabilities in [0,1] for plotting quantiles of the posterior distribution. Default is c(0.025, 0.975).

relative

A logical value indicating whether to plot relative spawning biomass (relative to B0). Default is TRUE.

labels

A character vector of labels for the model runs. If NULL (default), numeric labels are used.

Value

A ggplot2 object displaying spawning biomass trajectories by year and model.