Skip to contents

Plot natural mortality (M) by age.

Usage

plot_natural_mortality(data, object, posterior = NULL, probs = c(0.025, 0.975))

Arguments

data

A list containing the data that was passed to MakeADFun, including min_age and max_age.

object

A list specifying the AD object created using MakeADFun, with a report() method that returns M_a.

posterior

An rstan object created using the tmbstan function. If provided, posterior distributions are plotted. Default is NULL.

probs

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

Value

A ggplot2 object showing natural mortality by age with MLE estimates (dashed line) and optional posterior median and credible intervals.