Skip to contents

Calculates one-step-ahead residuals for the age-composition likelihoods using RTMB::oneStepPredict().

Usage

plot_af_residuals(
  fit = NULL,
  obj = NULL,
  fishery = c("Indonesian", "Australian"),
  seed = 123L,
  data = NULL,
  ...
)

Arguments

fit

An sbt_fit object.

obj

Legacy RTMB objective used only with a legacy data-list input.

fishery

Indonesian or Australian fisheries to plot, supplied as names or their valid numeric indices.

seed

Random seed used by randomized discrete residuals. Use NULL to leave the RNG state unchanged.

data

Legacy named alias for a model data list; supply obj as well.

...

Additional arguments passed to RTMB::oneStepPredict().

Value

A ggplot2 object with residual data, row diagnostics, non-finite residuals, observation name, and residual source attached as attributes.