8. Model parameterizations
Source:vignettes/model-parameterizations.Rmd
model-parameterizations.RmdPopulation dynamics
CEATTLE is an age-structured model that follows cohorts of a species
,
age
,
and sex
through time
.
Annual recruitment and the initial age structure are estimated, either
as random effects with the recruitment variance estimated, or as
penalized deviates with it fixed. Because the initial age structure is
estimated assuming the population was already depleted before the first
model year, the mean recruitment parameter
is biased low: projected recruitment should instead resemble the
hindcast recruitment deviations, and biomass reference points should use
the mean of annual recruitment. Populations are 1- or 2-sex via
nsex, with the sex ratio at birth
taken from the first age of sex_ratio. Natural mortality is
partitioned into predation mortality (M2) and residual mortality from
all other causes (M1), which is either input on the M1_base
sheet or estimated with M1Fun = build_M1(M1_model = ...) in
fit_mod(). Setting msmMode = 0 turns predation
off (below).
Predation sub-model
suitMode sets predator-prey preference (suitability,
that is predator selectivity) and msmMode the functional
response. The predation model is parameterized from the proportion by
weight of prey-at-age in a predator-at-age’s diet
(diet_data) and from ration/consumption (below).
Suitability
Suitability represents a predator’s prey and size preference, together with factors such as spatial overlap between predator and prey distributions.
MSVPA Type 2 based suitability
Suitability is derived empirically from the mean proportion by weight
of prey-at-age in the stomachs of predators-at-age,
(diet_data). Magnusson (1995) derives the suitability
coefficients. suitMode = 0 Predator-prey suitability for
predators of species
,
sex
,
age
,
and prey of species
,
sex
and age
Predation mortality
Single-species mode
Multiple independent single-species age-structured models: all
mortality is fishing plus input or estimated natural mortality
().
msmMode = 0
MSVPA Type 2 based predation mortality
msmMode = 1 An MSVPA-based formulation following
previous MSCAA models (Curti et al., 2013; Holsman et al., 2016; Tsehaye
et al., 2014). Predation mortality is built from suitability
coefficients
(estimated or empirical), input annual ration/consumption (below), mean
annual prey biomass whether estimated or input, and the input biomass of
other prey available to predator
().
Predation and biomass are interdependent, so predation mortality and the
age-structured dynamics are iterated to convergence; three to five
iterations suffice. Fits are generally insensitive to
over a range of values, which has historically been derived from
ecosystem-wide biomass estimates. For predators of species
,
sex
,
age
and prey of species
,
sex
,
age
MSVPA Type 3 based predation mortality
msmMode = 2 A Type III functional response variant of
the MSVPA predation model. The available-food denominator replaces prey
biomass
with
,
creating a sigmoidal (accelerating-then-saturating) relationship between
prey density and predation rate. This gives low-density prey a refuge
from predation and can stabilize multi-species dynamics at low stock
sizes.
Consumption
Consumption is either an environmentally driven bioenergetics model
or direct input of consumption-at-age, controlled per species on the
bioenergetics_control sheet:
-
CeqWhich bioenergetics equation scales maximum consumption with temperature: 1 = exponential (Stewart et al 1983); 2 = warm-water temperature dependence (Kitchell et al 1977; sensu Holsman et al 2015); 3 = cool- and cold-water temperature dependence (Thornton and Lessem 1979); 4 = temperature function held at 1.0, which bypasses bioenergetics and readsration_dataas empirical annual ration (setCA = 1,fday = 1,CB = 0) -
CindexWhichenv_dataindex supplies for bioenergetics-based ration -
PvalueTuning parameter scaling the maximum consumption used for ration -
fdayForaging days per year, -
CA, the intercept of the allometric mass function for maximum consumption, Cmax = CA * Weight ^ (1 + CB), with Weight in grams -
CB, the slope of that function -
Qc,Tco,Tcm,Tcl,CK1,CK4Parameters , , , , and of the temperature scaling function; which are read depends onCeq, per the algorithms below
ration_data holds the relative foraging rate
;
it, and so ration, can be tuned through fday and
Pvalue. The weight-at-age used in the consumption equations
is set by pop_wt_index.
Bioenergetics based ration
Ceq %in% 1:3 Individual specific ration
()
of predator
of sex
and age
in year
:
where
is weight-at-age in grams (the model stores it in kg
and multiplies by 1000 here) and
comes back in kg per predator per year, so
is the coefficient for a gram-scale weight. Ration can be tuned by
adjusting Pvalue
()
to help convergence:
Temperature scaling algorithms.
Ceq = 1: Exponential function from Stewart et al. 1983:
Ceq = 2: Temperature dependence for warm-water-species
from Kitchell et al. 1977:
Ceq = 3: Temperature dependence for cool and cold-water
species from Thornton and Lessem 1979:
Fishery and survey observation model
CEATTLE is fit to time series of fishery catch, survey biomass, and
length- or age-composition data. Log-catch and log-index observations
are normally distributed; age and length compositions are multinomial,
with their sample sizes input. There is no separate sex-ratio likelihood
component: sex-ratio information enters through joint
(comp_data$Sex = 3) composition data, whose female and male
cells are normalized together. The log-scale index SD is input,
estimated as a free parameter, or derived analytically following Walters
and Ludwig (1994), per Estimate_index_sd. Selectivity and
catchability are estimated or input separately for each fishery and
survey.
Catch is estimated in the model following the Baranov catch equation:
An index is predicted from catchability
and selectivity
,
in biomass
(mt) or in numbers
(thousands of fish), per Observation_units:
What differs between the two fleet types is the numbers the index
sees,
.
A survey index is a snapshot: the survey is on the
grounds at one point in the year,
,
and sees the numbers that have survived to it. That month is read from
the index_data row, not from the fleet, so a fleet whose
survey timing has moved carries a different value per year.
A fishery index is CPUE, which accumulates over the whole year alongside the catch rather than at an instant. Baranov gives , and effort cancels the (since ), leaving the same year-average numbers the catch equation uses:
is also what a fishery’s age composition is built on, so a fleet’s
index, catch and comps are consistent by construction, and
is not read for a fishery’s index rows. The model keys this on
Fleet_type; there is no column to set. The distinction
moves trend as well as scale, so a constant
cannot absorb it: at Month = 6,
approximates
to within 1% at
but is 9.6% low at
.
Stock Synthesis splits the same way on its per-fleet survey timing
(SS_expval.tpl:
;
,
required of every fishing fleet
).
See vignette("model-options-and-functionality") for the
seasonal-fishery case and the measured trend errors.
Selectivity parameterizations
Selectivity is controlled by Selectivity_index,
Selectivity, N_sel_bins,
Time_varying_sel, Time_varying_sel_sd and
Bin_first_selected on the fleet_control
sheet:
-
Selectivity_index: Fleets given the same value share one selectivity parameter block. -
Selectivity: Selectivity parameterization for the fleet: 0 or"Fixed"= empirical selectivity provided inemp_sel; 1 or"Logistic"; 2 or"NonParametric"sensu Ianelli et al 2018; 3 or"DoubleLogistic"; 4 or"DescendingLogistic"; 5 or"Hake", non-parametric sensu Taylor et al 2014; 6 or"2DAR1"for bin by year; 7 or"3DAR1"sensu Cheng et al (2024); 8 or"DoubleNormal", a four-parameter double normal (peak, ascending and descending widths, and a right-tail floor); this is the Stock Synthesis pattern 24 shape without its initial-selectivity and plateau-width parameters; 9 or"NonParametricPM", Ianelli non-parametric with the ADMB AMAK ("pm") penalty; 11 or"LogisticPM", the AMAK logistic with a free age-1 selectivity; 13 or"NonParametricIntegrable", the Ianelli base curve whose deviations have a proper density and so integrate underrandom_sel(Time_varying_selpicks the structure:"Off","IID"or"RandomWalk"). There is no 10, 12 or 14; the integer codes are frozen, because renumbering one would silently reinterpret every saved config and every fitted.rdsthat holds it. Whether a form is age- or length-based is set bySelectivity_dimension, not by the code. -
N_sel_bins: Number of age or length bins (perSelectivity_dimension) estimated for the non-parametric and AR1 forms; not read by the others. It is a count of bins, not an age: estimating up to age 6 meansN_sel_bins = 6whenminage = 1and 7 whenminage = 0. -
Time_varying_sel: Whether time-varying selectivity is estimated, for the logistic, double-logistic, descending-logistic and non-parametric forms. 0 or"Off"= no; 1 or"IID"= penalized deviates givenTime_varying_sel_sd, or random effects with that sd estimated underfit_mod(random_sel = TRUE); 3 or"Block"= time blocks with no penalty; 4 or"RandomWalk"= random walk following Dorn; 5 or"RandomWalkAscending"= random walk on the ascending portion of the double logistic only. Value 2 ("AR1") was removed in 5.16.0: it was never an AR1, and an autocorrelated deviation is now a selectivity linkage,linkage_spec(~ ar1(1 | Year)). The switch as a whole is soft-deprecated in favour of that grammar. -
Time_varying_sel_sd: The sd of the time-varying selectivity deviates. Underfit_mod(random_sel = FALSE)it is fixed at this value, per fleet. Underrandom_sel = TRUEthe deviates are integrated out and the sd is estimated, so this is only a starting value, and fleets sharing aSelectivity_indexshare one estimated sd started at the geometric mean of theirs. The 2DAR1 and 3DAR1 forms read it under everyTime_varying_sel, as the conditional sd of their deviation field, so they always need a positive value.Time_varying_q_sdis the catchability equivalent, underrandom_q. -
Bin_first_selected: First age/length bin with non-zero selectivity; the curve is 0 below it. A 1-based bin ordinal on the fleet’sSelectivity_dimension.
Selectivity penalty weights
Sel_curve_pen1/2/3 are penalty weights. Each
penalty is a Gaussian sum-of-squares
(),
so you may instead supply a standard deviation and let
switch_check() convert it with
.
Supplying an SD sets the matching Sel_curve_pen column; a
Sel_curve_pen you set directly is never overwritten.
Which form reads which slot, and what it charges:
| Slot | SD column | Reads the sign? |
NonParametric (2) |
NonParametricPM (9) |
NonParametricIntegrable (13) |
LogisticPM (11) |
|---|---|---|---|---|---|---|
Sel_curve_pen1 |
Sel_shape_sd |
only on 9 under Sel_shape_mode = "Directional"
|
shape, on the realized curve | shape, on the realized curve | shape, on the base curve | random walk on realized log-selectivity |
Sel_curve_pen2 |
Sel_curvature_sd |
no | 2nd-difference curvature, on the realized curve | 2nd-difference curvature, on the realized curve | 2nd-difference curvature, on the base curve | not read |
Sel_curve_pen3 |
Sel_devmag_sd |
no | not read | deviation magnitude | not read | random walk on the age-1 deviates |
Realized or base. Forms 2 and 9 charge the shape and
curvature penalties on the realized curve, accumulated over
sexes and years (form 2 under "IID" or
"RandomWalk", form 9 from Sel_start_year under
"RandomWalk"; 9 refuses "IID"). Form 13
charges them once per sex on the base coefficients. The same
weight therefore bites harder on a time-varying 2 or 9 – retune rather
than copy one across forms.
Three points that decide whether a value you set does anything:
-
The direction.
Sel_shape_dir = "Increasing"is implemented only byNonParametricPM(9) underSel_shape_mode = "Directional", where the template switches the one-sided penalty from the decreasing side to the increasing one. Everywhere else – including 9 under"Smooth", which is two-sided – the weight is applied as written, so"Increasing"is refused rather than silently negating it. -
The sign. A weight multiplies a squared deviation,
so a negative one rewards that deviation.
data_check()refuses a negativeSel_curve_penwherever the template reads it as a weight – which leaves four cases it does not refuse: the directional case above, aFleet_type = "Off"fleet (charged no selectivity penalty at all), a fleet that follows another’sSelectivity_indexand shares its selectivity form (the group’s penalty is charged once, on the lead), and a slot charged on deviates the fleet does not estimate, per the next point. -
Whether the deviates exist. The three cells above
marked as random walks or deviation magnitude are charged on the
time-varying deviates, so under
Time_varying_sel = "Off"they are identically zero and the weight is never read. Forms 2 and 13 do estimate deviates, but score them with a Gaussian density onTime_varying_sel_sd, which is why they never read slot 3.
The 2D/3D-AR1 forms (6/7) reuse Sel_curve_pen1/2/3 for
logit-scale correlations, not weights, and keep those columns. The
Hake form (5) reads no Sel_curve_pen slot.
Non-parametric (Type 1)
Input: Selectivity = 2 or "NonParametric",
N_sel_bins = 6, Sel_curve_pen1 = 12.5,
Sel_curve_pen2 = 200, and
Bin_first_selected = 1. See Selectivity penalty
weights above for the Sel_curve_pen slots and the
standard-deviation columns that set them.
Equation:
Logistic
Input: Selectivity = 1 or "Logistic",
N_sel_bins = NA, Time_varying_sel = 0, and
Time_varying_sel_sd = NA
Equation:
Time-varying logistic
Input: Selectivity = 1 or "Logistic",
N_sel_bins = NA, and Time_varying_sel_sd = 0.1
or another starting value.
Equation:
Penalized likelihood: Time_varying_sel = 1
Random effect: Time_varying_sel = 1 with
fit_mod(random_sel = TRUE), where the deviations are
integrated out by the Laplace approximation and
is estimated rather than fixed at Time_varying_sel_sd
Block: Time_varying_sel = 3, where the main parameters are
set to 0 and
Penalized likelihood random walk: Time_varying_sel = 4
Double logistic
Input: Selectivity = 3 or "DoubleLogistic",
N_sel_bins = NA, Time_varying_sel = 0, and
Time_varying_sel_sd = NA
Equation:
Time-varying double logistic 1 (ascending and descending time-varying parameters)
The four deviate structures – Time_varying_sel 1
penalized, 1 as a random effect under
fit_mod(random_sel = TRUE), 3 block, and 4 random walk –
are as under Time-varying logistic above.
Time-varying double logistic 2 (random walk ascending-time varying parameters)
Input: Selectivity = 3 or "DoubleLogistic",
N_sel_bins = NA, Time_varying_sel = 5, and
Time_varying_sel_sd = 0.05 or another starting value
Equation:
Descending logistic
Input: Selectivity = 4 or "DescendingLogistic",
N_sel_bins = NA, Time_varying_sel = 0, and
Time_varying_sel_sd = NA
Equation:
Time-varying descending logistic
Input: Selectivity = 4 or "DescendingLogistic",
N_sel_bins = NA, Time_varying_sel = 1, and
Time_varying_sel_sd = 0.05 or another starting value
Equation:
The four deviate structures are as under Time-varying logistic above.
Non-parametric (Type 2)
For each age there is an incremental selectivity parameter for the fleet . Selectivity at age is calculated as follows:
$$sel_{f_i sa}=e^{sel^{`}_{f_i sa} -
max(sel^{`}_{f_i sa})}$$ where $$
sel^{`}_{f_i sa} = \sum_{i=A_{min}}^a p_{f_i sa}$$ Selectivity is
0 for
,
and
above minage + N_sel_bins, so selectivity is constant
beyond the last estimated bin. minage, set in the data, is
the youngest age modeled.
Input: Selectivity = 5 or "Hake",
N_sel_bins = 6, Time_varying_sel = NA,
Time_varying_sel_sd = NA, and
Bin_first_selected =
Time-varying non-parametric (Type 2 for hake)
As above, but deviations on carry annual changes in selectivity, given a fixed or estimated standard deviation ():
Penalized likelihood: Time_varying_sel = 1
Random effect: Time_varying_sel = 1 with
fit_mod(random_sel = TRUE), where the deviations are
integrated out by the Laplace approximation and
is estimated rather than fixed at Time_varying_sel_sd
Catchability parameterizations
Catchability is controlled by the following
fleet_control columns:
-
Catchability_indexFleets given the same value share one catchability parameter. -
CatchabilityText or integer switch specifying catchability. 0 or “Fixed” = fixed atCatchability_init; 1 or “Estimated” = a single free parameter; 2 or “Estimated-with-prior” = a single free parameter with a prior; 3 or “Analytical” = analytical q from Walters and Ludwig 1994; 4 or “PowerEquation” = power equation, declared but not yet implemented; 5 or “Environmental” = linear equation log(q_y) = q_mu + beta * index_y; 6 or “AR1” = REMOVED in 5.12.0 (it never estimated the deviates, so q was constant) – express the Rogers et al. form as a q linkage withar1(1 | Year)andobserve =; 7 or “AnalyticalArith” = arithmetic-mean analytical q, the AMAK/ebswp form, paired with the MVN survey likelihood. -
Catchability_initStarting or fixed value for catchability -
Catchability_prior_sdLog-scale SD of the q prior: dnorm(log_q, log(Catchability_init) - bias_adjust_proc * sd^2/2, sd) -
Time_varying_qWhether a time-varying q is estimated. 0 = no; 1 = penalized deviate; 2 = AR1 (REMOVED in 5.16.0;data_check()errors); 3 = time blocks with no penalty; 4 = random walk from the mean following Dorn 2018 (dnorm(q_y - q_y-1, 0, sigma)). UnderCatchability = 5it instead holds theenv_dataindex for log(q_y) = q_mu + beta * index_y. -
Time_varying_q_sdFixed or starting sd of the time-varying q deviations, read underTime_varying_q1 and 4 and estimated underfit_mod(random_q = TRUE)
Linear time-invariant catchability formulations
All take Time_varying_q = 0.
Catchability = 0 fixes
at Catchability_init.
Catchability = 1 A free parameter
per index fleet
Catchability = 2 As above, with a lognormal prior on
Q prior (Catchability_init) is the prior
mean of
under fit_control(bias_adjust_proc = TRUE), the default,
and its median otherwise; Q sd prior is on the log
scale.
Catchability = 3
is derived analytically following Walters and Ludwig (1994): Walters, C.
and Ludwig, D. (1994) ‘Calculation of Bayes posterior probability
distributions for key population parameters’, Canadian Journal of
Fisheries and Aquatic Sciences, 51(3), pp. 713-722, doi:10.1139/f94-071. * CPUE
in weight, time-invariant survey SD:
* CPUE in numbers, time-invariant survey SD:
* CPUE in weight, time-varying survey SD:
* CPUE in numbers, time-varying survey SD:
Time-varying catchability formulations
Under Catchability = 2 the prior above still applies to
mean catchability.
Annual catchability estimated via penalized likelihood or as random effects
Catchability %in% c(1:2) and
Time_varying_q %in% c(1, 4)
Time_varying_q_sd,
with Time_varying_q_sd either fixed or estimated under
fit_mod(random_q = TRUE)
Catchability time-blocks
Catchability %in% c(1:2),
Time_varying_q = 3, with the blocks taken from
index_data.
Annual catchability via random walk
Catchability %in% c(1:2),
Time_varying_q = 4
Time_varying_q_sd