Bayesian stock reconstruction model of natural and hatchery origin fish,
fitted to coded wire tag data, observed escapement, and hatchery releases (Korman and Walters 2024).
Estimates time-varying maturity rate as well as time-varying ocean survival as a linear model of covariates (separate covariates
assumed between age 1 vs. ages 2+).
The model includes either a preterminal fishery, terminal fishery, or both (see Data and start sections of the documentation).
fit_CM()
generates the RTMB model from data which can then be passed to sample_CM()
to run the MCMC in Stan.
Arguments
- data
A list containing data inputs. See details.
- start
An optional list containing parameter starting values. See details.
- lower
Named list containing lower bounds for parameters. See details.
- upper
Named list containing upper bounds for parameters. See details.
- do_fit
Logical, whether to do the fit and estimate the Hessian.
- silent
Logical, whether to silence output from RTMB to the console.
- control
List,
control
argument to pass tostats::nlminb()
.- ...
For
fit_CM
, arguments toRTMB::MakeADFun()
. Forsample_CM
, arguments torstan::sampling()
- fit
List of output from
fit_CM()
Value
fit_CM()
returns a named list containing the RTMB model (obj
), nlminb output (opt
), standard errors (SD
), and parameter bounds (lower
andupper
)sample_CM()
returns astanfit
object containing the MCMC chains
Data
Data should passed through a named list with the following:
Nages
Integer, number of age classes in the modelLdyr
Integer, number of years in the modellht
Integer, life history type. Should be 1 for nowhatchsurv
Numeric, survival of hatchery releases into the smolt life stage. Density-independent.gamma
Optional. Numeric, the relative spawning success of hatchery origin spawners. Default is 1.ssum
Numeric, proportion of spawners that is femalefinitPT
Numeric, initial preterminal fishing mortality for calculating the equilibrium spawners at age in the first year of the model. Default is 0.finitT
Numeric, initial terminal fishing mortality for calculating the equilibrium spawners at age in the first year of the model. Default is 0.bmatt
Vector lengthNages
. Proportion maturity at age, base values for calculating the unfished replacement line.fec
Vector lengthNages
. Fecundity, egg production at agevulPT
Vector lengthNages
. Vulnerability at age to the preterminal fisheryvulT
Vector lengthNages
. Vulnerability at age to the terminal fisherymobase
. Vector lengthNages
. Natural mortality at age, base values for calculating the unfished replacement line and the the equilibrium spawners at age.cwtrelease
Vector lengthLdyr
, coded wire tag (CWT) releasescwtesc
Matrix[Ldyr, Nages]
. CWT escapement by brood year and age. Poisson likelhood.cwtcatPT
Matrix[Ldyr, Nages]
. CWT preterminal catch, by brood year and age. Poisson likelhood. Set all values to zero to turn off parameters related to the preterminal fishery.cwtcatT
Matrix[Ldyr, Nages]
. CWT terminal catch, by brood year and age. Poisson likelhood. Set all values to zero to turn off parameters related to the terminal fishery.RelRegFPT
VectorLdyr
. Trend in relative regional preterminal fishing mortality. Fishing mortality is estimated by estimating a scaling coefficient and annual deviations from this vector.RelRegFT
VectorLdyr
. Trend in relative regional terminal fishing mortality.obsescape
Vector lengthLdyr
, total observed escapement (all ages and both hatchery/natural fish). Lognormal likelhood.propwildspawn
Vector lengthLdyr
, proportion of the escapement that spawn (accounts for en-route mortality and broodtake)hatchrelease
Vector lengthLdyr+1
, number of hatchery juvenile fish releasedcwtExp
Numeric, the CWT sampling rate. This coefficient scales down the CWT predictions to match the observations. For example,cwtExp = 0.1
reduces the CWT predictions by 0.1 for the likelihood. Default is 1.covariate1
Optional. MatrixLdyr, ncov1
of linear covariates that predict natural mortality for age 1.covariate
Optional. MatrixLdyr, ncov
of linear covariates that predict natural mortality for ages 2+.s_enroute
Numeric, survival of escapement to spawning grounds. Default is 1.so_mu
Numeric, the prior mean for unfished spawners in logspace. Default islog(3 * max(data$obsescape))
.so_sd
Numeric, the prior standard deviation for unfished spawners in logspace. Default is 0.5.fitness
Logical, whether to calculate fitness effects on survival. Default isFALSE
.theta
Vector length 2, the optimum phenotype value for the natural and hatchery environments. Default is 100 and 80, respectively. See online article for more information.rel_loss
Vector length 3, the loss in fitness apportioned between the egg, fry (both prior to density-dependence), and smolt (after density-dependence) life stage. The three values should sum to 1.zbar_start
Vector length 2, the mean phenotype of the spawners and broodtake in the natural and hatchery environment, respectively, at the start of the model. Default values of 100 and 100, implying maximum fitness at for the natural environment at the start of the model.fitness_variance
Numeric. The variance of the phenotypic trait. Assumed identical between the natural and hatchery environments. Default is 10.selection_strength
Numeric. The ratio between the fitness standard deviation and the phenotype standard deviation. Default is 3.heritability
Numeric. The heritability of the phenotypic trait. Between 0-1. Default is 0.5.fitness_floor
Numeric. The minimum fitness value in the natural and hatchery environments. Default is 0.5.
start
Starting values for parameters can be provided through a named list:
log_cr
Numeric, log of the compensation ratio (productivity). Default is 3.log_so
Numeric, unfished spawners in logspace. Default islog(3 * max(data$obsescape))
.moadd
Numeric, additive term to base natural mortality rate for age 1 juveniles. Default is zero.wt
VectorLdyr
. Annual deviates in natural mortality during the freshwater life stage (affects survival to smolt life stage). Estimated with normal prior with mean zero and standard deviationp$wt_sd
. Default is zero.wto
VectorLdyr
. Annual deviates in natural mortality for age 2+ juveniles (marine life stage). Estimated with normal prior with mean zero and standard deviationp$wto_sd
. Default is zero.FbasePT
Numeric, scaling coefficient to estimate preterminal fishing mortality fromdata$RelRegFPT
. Default is 1.FbaseT
Numeric, scaling coefficient to estimate preterminal fishing mortality fromdata$RelRegFT
. Default is 1.fanomalyPT
VectorLdyr
. Annual deviates fromFbasePT * data$RelRegFPT
to estimate preterminal fishing mortality. Estimated with normal prior with mean zero and standard deviationp$fanomaly_sd
. Default is zero.fanomalyT
VectorLdyr
. Annual deviates fromFbaseT * data$RelRegFT
to estimate terminal fishing mortality. Estimated with normal prior with mean zero and standard deviationp$fanomalyPT_sd
. Default is zero.lnE_sd
Numeric, lognormal standard deviation of the observed escapement. Estimated with hierarchicalgamma(2, 5)
prior. Default is 0.1.wt_sd
Numeric, lognormal standard deviation of the age 1 (freshwater) natural mortality deviates. Estimated with hierarchicalgamma(2, 5)
prior. Default is 1.wto_sd
Numeric, lognormal standard deviation of the age 2+ (marine) natural mortality deviates. Estimated with hierarchicalgamma(2, 5)
prior. Default is 1.fanomalyPT_sd
Numeric, lognormal standard deviation offanomalyPT
. Estimated with hierarchicalgamma(2, 5)
prior. Default is 1.fanomalyT_sd
Numeric, lognormal standard deviation offanomalyT
. Estimated with hierarchicalgamma(2, 5)
prior. Default is 1.logit_matt
MatrixLdyr, Nages-2
maturity by year and age in logit space. Maturity is fixed to zero and one at age 1 and the maximum age, respectively. Default is 0.1.sd_matt
VectorNages-2
. Logit standard deviation of maturity (logit_matt
) by age class. Default is 0.5.b1
Vectorncov1
of coefficients for linear covariates that predict natural mortality for age 1. Default is zero.b
Vectorncov
of coefficients for linear covariates that predict natural mortality for ages 2+. Default is zero.
Bounds
By default, the standard deviation parameters and parameters in normal space (e.g., FbasePT
, Fbase_T
) have a lower bound of zero.
moadd
has a lower bound of zero by default, but it is feasible that this parameter can be negative as well.
Deviation parameters centred around zero are bounded between -3 to 3.
The log_cr
parameter has a lower bound of zero.
All other parameters are unbounded.
Covariates on natural mortality
Natural mortality is modeled as the sum of a base value \(M^\textrm{base}\), additional scaling factor for age 1 \(M^\textrm{add}\), a linear system of covariates \(X\) and coefficients \(b\):
$$ M_{y,a} = \begin{cases} M^\textrm{base}_a + M^\textrm{add} + \sum_j b^1_j X^1_{y,j} & \quad a = 1\\ M^\textrm{base}_a + \sum_j b_j X_{y,j} & \quad a = 2, \ldots, A \end{cases} $$
References
Korman, J. and Walters, C. 2024. A life cycle model for Chinook salmon population dynamics. Canadian Contractor Report of Hydrography and Ocean Sciences 62: vi + 60 p.