sim_abundance( ages =1:20, years =1:20, Z = sim_Z(), R = sim_R(), N0 = sim_N0(), growth = sim_vonB())
Arguments
ages: Ages to include in the simulation.
years: Years to include in the simulation.
Z: Total mortality function, like sim_Z, for generating mortality matrix.
R: Recruitment (i.e. abundance at min(ages)) function, like sim_R, for generating recruitment vector.
N0: Starting abundance (i.e. abundance at min(years)) function, like sim_N0, for generating starting abundance vector.
growth: Closure, such as sim_vonB, for simulating length given age. The function is used here to generate a abundance-at-age matrix and it is carried forward for later use in sim_survey to simulate lengths from survey catch at age.
Returns
A list of length 9:
ages - Vector of ages in the simulation
lengths - Vector of length groups (depends on growth function)
years - Vector of years in the simulation
R - Vector of recruitment values
N0 - Vector of starting abundance values
Z - Matrix of total mortality values
N - Matrix of abundance values
N_at_length - Abundance at length matrix
sim_length - Function for simulating lengths given ages
Details
Abundance from is calculated using a standard population dynamics model. An abundance-at-length matrix is generated using a growth function coded as a closure like sim_vonB. The function is retained for later use in sim_survey
to simulate lengths given simulated catch at age in a simulated survey. The ability to simulate distributions by length is yet to be implemented.