getResiduals: Gather stock-recruit residuals

View source: R/getResiduals.R

getResidualsR Documentation

Gather stock-recruit residuals

Description

This function fits simple stock-recruit models (Ricker or Larkin) to generate model residuals that can be merged with simulated recruitment deviations. Useful for posterior predictive comparisons and generating output figures if model residuals are a variable of interest.

Usage

getResiduals(recList, modelVec)

Arguments

recList

A list of length nCU with each element a dataframe with nrow = to length of the maximum observed timeseries. Each dataframe should contain the following columns: an estimate of total recruitment (by brood year), spawner abundance, and brood year. Lagged spawner abundances are automatically generated by the function.

modelVec

A character vector of model names with length nCU (ricker or larkin).

Value

A numeric matrix of model residuals with nrow = nrow(input data) and ncol = nCU.

Examples

EXAMPLE DATA NEEDS TO BE GENERATED

Pacific-salmon-assess/samSim documentation built on Jan. 20, 2025, 11:17 a.m.