ssb_at_age()
View source ↗On this page
Spawning stock biomass by time step from a maturity ogive by age, next to the spawning stock biomass of the model from maturity at length.
Usage
ssb_at_age(fit, maturity, weight = NULL)
Arguments
| Argument | Default | Description |
|---|---|---|
fit | required | An ACL or ALSCL fit, or a saved fit read with |
maturity | required | Proportion mature at age, between 0 and 1. A numeric vector with one value per age class of the fit, in the order of |
weight | NULL | NULL (default) uses the biomass at age of the model, which follows from the weight at length supplied to the fit. Otherwise mean weight at age, as a vector or matrix of the same form as |
Value
A data frame with one row per time step and the columns year (as in fit$year), SSB (from maturity at age), SSB_model (the SSB of the model, from maturity at length) and numerical_ok (the verdict of the numerical checks of the fit).
Details
Spawning stock biomass (SSB) is calculated as the sum over age classes of biomass at age multiplied by the proportion mature at age. ACL and ALSCL calculate SSB from the proportion mature at length. This function gives the SSB that corresponds to a maturity ogive by age, such as the one used in an age-based assessment of the same stock. Biomass at age of an ALSCL fit is fit$report$BA. An ACL fit does not report biomass at age. It is calculated as numbers at age multiplied by mean weight at age, where mean weight at age is the weight at length supplied to the fit averaged over the age-length key.
The SSB of the model (fit$report$SSB) is the sum over length bins of biomass at length multiplied by the proportion mature at length supplied to the fit. The two series are equal when maturity at age is the mean of maturity at length within each age class and time step, weighted by biomass at length (for ALSCL, fit$report$SBA / fit$report$BA). They differ in three cases. First, the maturity ogive by age comes from a source other than the maturity at length supplied to the fit, for example from an age-based assessment. Second, maturity at age is constant over time, whereas the lengths at age in the model, and with them the proportion mature at age implied by maturity at length, change over time or differ from those of the stock. Third, one proportion is applied to all fish of an age class, whereas maturity at length is higher for the large fish of the age class, which are also the heavy ones. With maturity at age equal to the mean of maturity at length weighted by numbers, and weight and maturity both increasing with length, the SSB from maturity at age is the lower of the two.
Both series are in the unit of model biomass, whose level depends on the assumed survey catchability. Compare the trend with an external series, not the level.
Additional details from R help
Biomass at age of an ALSCL fit is fit$report$BA. An ACL fit
does not report biomass at age. It is calculated as numbers at age
multiplied by mean weight at age, where mean weight at age is the weight
at length supplied to the fit averaged over the age-length key.
The SSB of the model (fit$report$SSB) is the sum over length bins of
biomass at length multiplied by the proportion mature at length supplied
to the fit. The two series are equal when maturity at age is the mean of
maturity at length within each age class and time step, weighted by
biomass at length (for ALSCL, fit$report$SBA / fit$report$BA). They
differ in three cases. First, the maturity ogive by age comes from a
source other than the maturity at length supplied to the fit, for
example from an age-based assessment. Second, maturity at age is constant
over time, whereas the lengths at age in the model, and with them the
proportion mature at age implied by maturity at length, change over time
or differ from those of the stock. Third, one proportion is applied to
all fish of an age class, whereas maturity at length is higher for the
large fish of the age class, which are also the heavy ones. With maturity
at age equal to the mean of maturity at length weighted by numbers, and
weight and maturity both increasing with length, the SSB from maturity at
age is the lower of the two.
Both series are in the unit of model biomass, whose level depends on the assumed survey catchability. Compare the trend with an external series, not the level.
Examples
Run the setup before the example. Fitting examples require an R-compatible C++ toolchain; simulation and export examples may write files.
Example setup
library(ALSCL)
library(ggplot2)
library(patchwork)
data("YTF_example")
x <- YTF_example
inputs <- x[c("data.CatL", "data.wgt", "data.mat")]
dat <- x$data.CatL
a <- run_acl(x, silent = TRUE)
b <- run_alscl(x, silent = TRUE)
# An assumed maturity ogive by age: half of the fish mature at the fourth age class, all fish from the fifth
ogive <- pmin(1, pmax(0, (seq_along(a$age) - 3) / 2))
ssb <- ssb_at_age(a, maturity = ogive)
head(ssb)
cor(log(ssb$SSB), log(ssb$SSB_model))