length_at_age()
View source ↗On this page
Mean and standard deviation of length for each age class and time step of a fitted ACL or ALSCL model, in the population and as the survey sees it.
Usage
length_at_age(fit, basis = c("survey", "population"))
Arguments
| Argument | Default | Description |
|---|---|---|
fit | required | An ACL or ALSCL fit, or a saved fit read with |
basis | c("survey", "population") | One or both of "survey" (numbers at length multiplied by survey catchability at length) and "population" (numbers at length in the population). The default returns both. Letter case does not matter. |
Value
A data frame with one row per basis, time step and age class and the columns basis, year (the time step, as in fit$year), age (the age class, as in fit$age; the oldest age class is a plus group), mean_length and sd_length (in the length unit of the length bins) and numerical_ok (the verdict of the numerical checks of the fit, the same that summary() reports).
Details
For an ALSCL fit the quantities are calculated from the estimated numbers by length bin, age class and time step (fit$report$NLA). For an ACL fit they are calculated from the age-length key (fit$report$pla, the probability of each length bin given age). ACL uses the same key in every time step, so its values with basis = "population" do not change with time; with basis = "survey" they change with time only when survey_q is a matrix by length and time step. Each length bin is represented by its midpoint, including the two open-ended outer bins. The standard deviation is that of the bin midpoints weighted by numbers and does not include the spread of lengths within a bin. Where a large share of an age class lies in the first or the last length bin, the mean is drawn toward the midpoint of that bin and the standard deviation is too small.
With basis = "survey", the numbers in each length bin are multiplied by the survey catchability at length before the mean and standard deviation are calculated. Where catchability increases with length over the lengths of an age class, the small fish of that age class are under-represented in the survey catch, and mean length at age is larger than in the population. Use this basis to compare the fit with mean length at age from age readings of fish caught in the same survey.
Compare growth through mean length at age, not through the growth parameters. In ACL, Linf, k and t0 are the parameters of a von Bertalanffy curve of mean length at age. In ALSCL they are not. Linf and k set the mean growth increment in one time step as a function of length, and Linf, k and t0 set the mean length of recruits (and, in the original structure, of every age class in the first time step; see structure in run_alscl()). After recruitment, the lengths of a cohort follow from the growth increments and from mortality at length. Growth parameters estimated from growth increments and from age-length data have different meanings and are not directly comparable (Francis 1988). Linf, k and t0 of an ALSCL fit should therefore not be compared with those of an ACL fit or of a von Bertalanffy curve fitted to age readings.
Reference: Francis, R. I. C. C. (1988). Are growth parameters estimated from tagging and age-length data comparable? Canadian Journal of Fisheries and Aquatic Sciences, 45, 936-942. doi:10.1139/f88-115.
Additional details from R help
For an ALSCL fit the quantities are calculated from the estimated
numbers by length bin, age class and time step (fit$report$NLA). For an
ACL fit they are calculated from the age-length key (fit$report$pla, the
probability of each length bin given age). ACL uses the same key in every
time step, so its values with basis = "population" do not change with
time; with basis = "survey" they change with time only when survey_q is
given as a matrix by length and time step. Each length bin is
represented by its midpoint, including the two open-ended outer bins.
The standard deviation is that of the bin midpoints weighted by numbers
and does not include the spread of lengths within a bin. Where a large
share of an age class lies in the first or the last length bin, the mean
is drawn toward the midpoint of that bin and the standard deviation is
too small.
With basis = "survey", the numbers in each length bin are multiplied by
the survey catchability at length before the mean and standard deviation
are calculated. Where catchability increases with length over the
lengths of an age class, the small fish of that age class are
under-represented in the survey catch, and mean length at age is larger
than in the population. Use this basis to compare the fit with mean
length at age from age readings of fish caught in the same survey.
Compare growth through mean length at age, not through the growth
parameters. In ACL, Linf, k and t0 are the parameters of a von
Bertalanffy curve of mean length at age. In ALSCL they are not. Linf and
k set the mean growth increment in one time step as a function of
length, and Linf, k and t0 set the mean length of recruits (and, in the
original structure, of every age class in the first time step; see
structure in run_alscl()). After recruitment, the lengths of a cohort
follow from the growth increments and from mortality at length. Growth
parameters estimated from growth increments and from age-length data
have different meanings and are not directly comparable (Francis 1988).
Linf, k and t0 of an ALSCL fit should therefore not be compared with
those of an ACL fit or of a von Bertalanffy curve fitted to age readings.
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)
# Use objects defined above
growth <- length_at_age(b)
head(growth)
# Mean length at age as the survey sees it, in the last time step
subset(growth, basis == "survey" & year == max(year))