Skip to contents

Plot recruitment deviates by year.

Usage

plot_rec_devs(
  data,
  object,
  proj = NULL,
  posterior = NULL,
  probs = c(0.025, 0.975),
  n_worms = 3
)

Arguments

data

A list containing data passed to MakeADFun, must contain first_yr and last_yr.

object

A list specifying the AD object created using MakeADFun.

proj

A list or NULL containing optional projection data with proj_rdev_y (default NULL).

posterior

An snutsfit/tmbfit object or NULL containing optional posterior samples created using tmbstan or sample_sparse_tmb (default NULL).

probs

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

n_worms

An integer specifying the number of random posterior trajectories to display (default 3).

Value

A ggplot2 object showing recruitment deviates over time.