Set up the recruitment module and associated processes
Setup_Mod_Rec.RdConfigures all recruitment-related components of the estimation model:
stock-recruit relationship type and density-dependence structure,
Beverton-Holt steepness and priors, recruitment variability
(\(\sigma_R\)), annual and initial age-structure deviations, regional
and seasonal recruitment apportionment, spawning movement and stray rates,
sex ratio dynamics, equilibrium initialization method, and the recruitment
bias ramp. Delegates parameter mapping to a family of internal helpers
(do_sigmaR_mapping, do_RecDevs_mapping,
do_InitDevs_mapping, do_h_mapping,
do_sexratio_pars_mapping,
do_rec_region_prop_mapping,
do_rec_seas_prop_mapping). Must be called after
Setup_Mod_Dim and Setup_Mod_Biologicals, and
before model compilation.
Usage
Setup_Mod_Rec(
input_list,
rec_model,
rec_dd = "global",
rec_lag = 1,
SR_ref_yr = 1,
Use_h_prior = 0,
h_prior = NULL,
rec_region_prop_spec = NULL,
use_rec_region_prop_prior = 0,
rec_region_prop_prior = NULL,
rec_seas_prop_spec = "fix",
use_rec_seas_prop_prior = 0,
rec_seas_prop_prior = NULL,
use_fixed_rec_seas_prop = 1,
fixed_rec_seas_prop = {
rec_seas_prop = array(0, dim = c(input_list$data$n_pop,
input_list$data$n_seas))
rec_seas_prop[, 1] <- 1
rec_seas_prop
},
do_rec_bias_ramp = 0,
bias_year = NA,
max_bias_ramp_fct = 1,
sigmaR_switch = 1,
dont_est_recdev_last = 0,
dont_pen_recdev_first = 0,
init_age_strc = 2,
equil_init_age_strc = 1,
init_F_prop = array(0, dim = c(input_list$data$n_regions, input_list$data$n_seas,
input_list$data$n_fish_fleets)),
init_F_form = "prop",
init_F_spec = "fix",
sigmaR_spec = "est_all",
InitDevs_spec = NULL,
InitDevs_sex_spec = "est_shared_s",
RecDevs_spec = NULL,
RecDevs_model = "iid",
RecDevs_rho_spec = "fix",
RecDevs_rw_init_sigma = 5,
RecDevs_pen_center = "fixed",
Use_rec_level_pen = 0,
rec_level_pen_sigma = 1,
rec_level_pen_center = "own_mean",
rec_level_pen_yrs = NULL,
Use_init_sex_pen = 0,
init_sex_pen_sigma = 1,
sr_penalty = "none",
sr_pen_sigma = 1,
sr_pen_yrs = NULL,
sr_R0_spec = "shared",
InitDevs_pen_center = "fixed",
h_spec = NULL,
sgl_seas_spawning_movement = NA,
t_spawn = 0,
stray_rate_spec = "fix",
stray_rate_blocks = paste0("none_Pop_", seq_len(input_list$data$n_pop)),
use_fixed_stray_rate = if (stray_rate_spec != "fix") 0 else 1,
fixed_stray_rate = array(0, dim = c(input_list$data$n_pop,
length(input_list$data$years))),
use_stray_rate_prior = 0,
stray_rate_prior = NULL,
spawn_seas = 1,
sexratio_spec = "fix",
sexratio_blocks = {
grid <- expand.grid(region = 1:input_list$data$n_regions, pop
= 1:input_list$data$n_pop)
blks <- paste0("none_Pop_", grid$pop, "_Region_",
grid$region)
blks
},
use_rinit = 0,
init_age_devs_shared = NULL,
R0_blocks = NULL,
R0_ref_block = 1,
use_r0_prior = 0,
r0_prior = NULL,
Use_rinit_pen = 0,
rinit_pen_sd = 1,
...,
ln_global_R0_spec = "est"
)Arguments
- input_list
Named list with
$data,$par,$map, and$verbosesublists, as returned by upstream setup functions. Population, region, age, year, and season dimensions must already be defined in$data.- rec_model
Character string (required). Stock-recruit relationship:
"mean_rec"Fixed mean recruitment; no stock-recruit relationship. Steepness is automatically fixed and not estimated.
"bh_rec"Beverton-Holt stock-recruit relationship.
"ricker_rec"Ricker stock-recruit relationship, in the depletion form \(R = R_0 (S/S_0) \exp(\alpha (1 - S/S_0))\) with \(\alpha = \log(4h/(1-h))\). Steepness is not interchangeable with
"bh_rec"; seeGet_Det_Recruitment.
- rec_dd
Density-dependence structure. Default
"global"."local"Independent stock-recruit relationship per population. Required when
n_pop > 1."global"Single pooled spawner-recruit relationship across all regions. Constrains
h_spec,RecDevs_spec, andInitDevs_specto shared or fixed options whenn_regions > 1.
- rec_lag
Integer. Lag between spawning biomass and recruitment (in seasons).
1(default) is the classic lagged case: recruitment uses SSB fromrec_lagseasons prior and may enter in any season.0is age-0 recruitment: recruitment uses the SAME year's SSB, and because that SSB isn't known untilspawn_seasis reached, recruits may only enter inspawn_seasitself or a later season, whenuse_fixed_rec_seas_prop = 1,fixed_rec_seas_propmust be zero beforespawn_seas; when estimated, this is enforced structurally via a restricted softmax (seedo_rec_seas_prop_mapping).- SR_ref_yr
Integer year index supplying every input to unfished spawning biomass per recruit, and so to
S0and the scale of the stock-recruit curve. Matches the estimation model'sSR_ref_yr. Default1.- Use_h_prior
Integer (0/1). Whether normal priors on steepness are applied. Only relevant when a stock-recruit curve is used (
rec_model = "bh_rec"or"ricker_rec"). Default0.- h_prior
Data frame of steepness prior parameters. Required columns:
pop,region,mu,sd. Ignored whenUse_h_prior = 0. DefaultNULL.- rec_region_prop_spec
Character or
NULL. Regional recruitment dispersal structure. DefaultNULL(estimate all proportions freely). Seedo_rec_region_prop_mappingfor full option descriptions including"no_dispersal". Stored as$data$rec_region_prop_spec:0= full dispersal,1= no dispersal.- use_rec_region_prop_prior
Integer (0/1). Whether Dirichlet priors are applied to regional recruitment proportions. Not valid when
n_regions = 1. Default0.- rec_region_prop_prior
Data frame of Dirichlet prior concentration parameters. Required columns:
popandalpha, wherealphais a list-column of length-n_regionsvectors. Ignored whenuse_rec_region_prop_prior = 0. DefaultNULL.- rec_seas_prop_spec
Character or
NULL. Seasonal recruitment apportionment structure. Default"fix". Seedo_rec_seas_prop_mappingfor full option descriptions including"est_shared_pop".- use_rec_seas_prop_prior
Integer (0/1). Whether Dirichlet priors are applied to seasonal recruitment proportions. Not valid when
n_seas = 1. Whenrec_lag = 0andspawn_seas > 1, the prior is evaluated only over seasonsspawn_seas:n_seas(the seasons beforespawn_seasare structurally zero, not estimated). Default0.- rec_seas_prop_prior
Data frame of Dirichlet prior concentration parameters for seasonal proportions. Required columns:
popandalpha. Ignored whenuse_rec_seas_prop_prior = 0. DefaultNULL.- use_fixed_rec_seas_prop
Integer (0/1). Whether fixed (non-estimated) seasonal proportions from
fixed_rec_seas_propare used. Automatically reset to0with a warning ifrec_seas_prop_specrequests estimation. Default1.- fixed_rec_seas_prop
Array
[n_pop x n_seas]. Fixed seasonal recruitment proportions used whenuse_fixed_rec_seas_prop = 1. Default: all recruitment assigned to season 1. Whenrec_lag = 0andspawn_seas > 1, must be zero for every season beforespawn_seas. An error is raised otherwise.- do_rec_bias_ramp
Integer (0/1). Whether a recruitment bias ramp is applied to
ln_RecDevsto account for reduced information in early and terminal years. Default0.- bias_year
Numeric. Calendar year at which the bias ramp reaches its maximum correction. Only used when
do_rec_bias_ramp = 1. DefaultNA.- max_bias_ramp_fct
Numeric in \([0, 1]\). Maximum bias correction factor applied at
bias_year. Default1.- sigmaR_switch
Integer. Year index at which \(\sigma_R\) switches from the early-period value (index 1) to the late-period value (index 2). If \(\leq 1\), a single \(\sigma_R\) is applied throughout. Default
1.- dont_est_recdev_last
Non-negative integer. Number of terminal years for which recruitment deviations are not estimated. Automatically overridden to
0ifn_proj_yrs_devs > 0, since projected deviation years are penalized toward the mean and are effectively estimated regardless. Default0.- dont_pen_recdev_first
Integer. How many leading years of recruitment deviations are estimated but left out of the recruitment penalty.
0(default) penalizes every year.The first year's recruitment is the first year's age one abundance, which in an equilibrium initialization belongs to the initial condition rather than to the recruitment process. WHAM keeps it as a separate initial numbers at age parameter and gives it no process error at all, and setting this to
1is the same statement: the deviation is still estimated, so the data set the first year's recruitment freely, but it takes no prior fromln_sigmaR. Mapping the deviation off instead would fix it at its starting value rather than leave it free.Leaving years out only removes their penalty, never their estimation, so this is separate from
dont_est_recdev_last, which does the opposite at the other end of the series.- init_age_strc
Initialization method. Default
2. Options0/"iterative",1/"scalar_no_move",2/"matrix", and3/"scalar_plus_only"all project an equilibrium age structure forward fromR0and treatln_InitDevsas multiplicative deviations from it.4/"free"projects no equilibrium at all: the numbers at age 2 and older areexp(ln_InitDevs), apportioned by sex ratio, with age 1 still taken from recruitment. Use it when the initial age structure has no information aboutR0and should not be pulled toward an equilibrium. Note that under4the deviations are on the scale of numbers rather than of log ratios, so the penalty applied throughequil_init_age_strcis a prior on log abundance; pair it withequil_init_age_strc = 0if no such prior is wanted.0/"iterative"Iterates the population to approximate equilibrium. Slowest but most general.
1/"scalar_no_move"Scalar geometric series assuming no movement.
2/"matrix"Matrix geometric series incorporating movement. Recommended default for spatial models.
3/"scalar_plus_only"Scalar geometric series with movement only in the plus group.
- equil_init_age_strc
Plus-group treatment during stochastic initialization. Default
1.0/"equil"Deterministic equilibrium; no
ln_InitDevsare estimated.1/"stoch_no_plus"Stochastic deviations for all ages except the plus group.
2/"stoch_all"Stochastic deviations for all ages including the plus group.
3/"stoch_shared_ages"Stochastic deviations with user-defined age sharing via
init_age_devs_shared. Deviations are estimated independently across all populations and regions, but ages sharing the same value ininit_age_devs_sharedare constrained to a single parameter. The plus group is not automatically fixed; include anNAininit_age_devs_sharedat the plus-group position to fix it, or share it with the preceding age by repeating that index (e.g.c(1:42, rep(42, 9))). Requiresinit_age_devs_sharedto be non-NULL.4/"stoch_all_no_pen"Deviations estimated for all ages including the plus group, and none of them penalized. The same cells
"stoch_all"estimates, with no prior on any of them. Pair it withinit_age_strc = "free", where the deviations are the initial log numbers at age rather than departures from an equilibrium, so a penalty on them would be a prior on initial abundance rather than on the shape of the age structure. This is what ICES assessments in the SAM family do with their first year.
"equil"means both no penalty and no estimation, which are the same statement about an equilibrium age structure and two different ones about a free age structure."stoch_all_no_pen"is the second of them.- init_F_prop
Numeric array
[n_regions x n_seas x n_fish_fleets]. Legacy interface, retained for backwards compatibility. A fixed proportion of the estimated mean F applied during equilibrium initialization. When supplied non-zero (andinit_F_paris not given) it is converted toln_init_F = log(init_F_prop)withinit_F_form = "prop", which reproduces the previous behavior exactly. Preferinit_F_par. Default: zero for all seasons and fleets.- init_F_form
Character. What the
init_F_parparameter MEANS:"prop"(default):init_F = exp(ln_init_F) * exp(ln_F_mean), a proportion of the estimated mean F, so the initial age structure moves with it."abs":init_F = exp(ln_init_F), an absolute fishing mortality independent ofln_F_mean.
Use
"abs"when bridging an assessment that has a separate historical F (one estimated as its own parameter, distinct from the mean log fishing mortality). Under"prop"those two quantities collapse into a single parameter, and because catch constrains only the PRODUCT of numbers and fishing mortality, the optimizer can raiseln_F_meanto deplete the initial age structure and raise F together, fitting catch just as well with a smaller, harder-fished stock. That is a genuine second solution branch, not a rounding difference.- init_F_spec
Character,
"fix"(default) or"est". Whetherinit_F_paris estimated. This sets only the mapping, so it combines freely withinit_F_form, including estimating the proportion itself (init_F_form = "prop",init_F_spec = "est"). Noteinit_Fis generally weakly identified, which is why assessments commonly fix it."est"is refused underinit_age_strc = "free", where no equilibrium is projected andinit_F_parnever reaches the objective.The value is set by the parameter
init_F_par[n_regions x n_seas x n_fish_fleets], supplied through...like any other starting value, e.g.Setup_Mod_Rec(..., init_F_form = "abs", init_F_spec = "fix", init_F_par = array(log(0.01), dim = c(1, 1, 1))). Its SCALE depends oninit_F_form, logit under"prop"(so the proportion is bounded to (0, 1)) and log under"abs", which is why it is not namedln_orlogit_. Defaults to effectively no initial fishing mortality.- sigmaR_spec
Character. Estimation structure for \(\sigma_R\), stored in
ln_sigmaR[2 x n_pop x n_regions], where index 1 = initial deviation period and index 2 = annual deviation period. Default"est_all". Seedo_sigmaR_mappingfor full option descriptions.- InitDevs_spec
Character or
NULL. Sharing structure for initial age-structure deviationsln_InitDevs[n_pop x n_regions x (n_ages - 1) x n_sexes]. DefaultNULL(estimate all independently). Seedo_InitDevs_mappingfor full option descriptions.- InitDevs_sex_spec
Character.
"est_shared_s"(default) estimates one initial age deviation curve read by every sex, which is how the model has always behaved."est_all"gives each sex its own curve, each penalized under the initial-age penalty, with an"own_mean"InitDevs_pen_centerpooled across sexes so the sexes share one estimated level the way assessments with a common mean-log-initial and sex-specific deviations are written. Requiresn_sexes > 1.- RecDevs_spec
Character or
NULL. Sharing structure for annual recruitment deviationsln_RecDevs[n_pop x n_regions x n_years]. DefaultNULL(estimate all independently). Seedo_RecDevs_mappingfor full option descriptions.- RecDevs_model
Character string giving the process error structure on the recruitment deviations
ln_RecDevs. The same three formsFdev_modeloffers:"iid"Default. Independent deviations about the prior mean set by
RecDevs_pen_center, which is the classic mean recruitment with lognormal deviations."rw"Random walk. Each deviation is centered on the previous estimated one, so recruitment is free to move but not to jump, which is the state-space recruitment SAM fits by default. The first estimated deviation is given a diffuse normal, so the level of the series is set by
R0and the data rather than by the penalty."ar1"AR1. As the walk, but each deviation reverts toward zero at rate
RecDevs_rho, and the first estimated deviation is drawn from the stationary marginal distribution.
A step spans the gap between estimated years rather than calendar years, so mapping deviations off through
RecDevs_specordont_est_recdev_lastcloses the gap rather than splitting the series. The walk and the AR1 center each deviation on the previous one, so neither can be combined withdo_rec_bias_ramp = 1orRecDevs_pen_center = "own_mean", both of which assert a mean about zero; each combination is rejected.sigmaR_switchstill applies, so the walk can take one standard deviation early and another late.- RecDevs_rho_spec
Character string specifying the sharing structure for the AR1 correlation parameter
RecDevs_rho[n_pop x n_regions]: one of"est_all","est_shared_pop","est_shared_r","est_shared_pop_r", or"fix"(default). Only read whenRecDevs_model = "ar1"; every otherRecDevs_modelmaps the parameter off. Seedo_RecDevs_rho_mapping.- RecDevs_rw_init_sigma
Numeric. Standard deviation given to year one of a random walk, which is what sets the level of the recruitment series. Default
5, wide enough that the level is decided byR0and the data.NAinstead starts the walk at zero under its own sigma, which pulls the first year toward mean recruitment. Only read whenRecDevs_model = "rw".- RecDevs_pen_center, InitDevs_pen_center
Where the recruitment and initial age deviation penalties are centered.
"fixed"(default) centers on the asserted prior mean, zero or the bias-corrected \(-\sigma_R^2/2\), which constrains both the level and the spread of the deviations."own_mean"centers on the mean of the estimated deviations themselves, so only their spread is penalized and their level is left free; that is what a sum of squares about the series' own mean amounts to. The level being unpenalized means it must be pinned elsewhere, by a prior onR0or by fixing a deviation, or the likelihood is flat along it. Cannot be combined withdo_rec_bias_ramp = 1, whose offset is meaningless once the mean is estimated rather than asserted.- Use_rec_level_pen
Integer (0/1). Whether a penalty is applied to the log recruitment series itself, separately from the deviation penalty. Under a stock-recruit relationship the deviations are residuals about the predicted curve, so this is the only way to also say that the recruitment series should not wander. Default
0.- rec_level_pen_sigma
Numeric standard deviation of that penalty. A sum of squares with weight \(w\) corresponds to \(1/\sqrt{2w}\). Default
1.- rec_level_pen_center
Either
"own_mean"(default), centering on the mean of the log recruitment series so only its variability is penalized, or"fixed", centering on zero.- rec_level_pen_yrs
Vector of years the penalty applies over, or
NULL(default) for every year.- Use_init_sex_pen
Integer (0/1). Whether each later sex's initial age deviations are tied to the first sex's, through a Gaussian on their difference at every age the initial-age penalty covers. A statement about how different the sexes' initial age structures may be, separate from the initial-age penalty's statement about how variable each curve is. Requires
n_sexes > 1andInitDevs_sex_spec = "est_all"(under"est_shared_s"the difference is identically zero). Enters the objective unweighted. Default0.- init_sex_pen_sigma
Numeric standard deviation of that tie. A sum of squares with weight \(w\) corresponds to \(1/\sqrt{2w}\). Default
1.- sr_penalty
Character.
"none"(default),"bh"or"ricker". Only valid withrec_model = "mean_rec". Fits a stock-recruit curve as a LIKELIHOOD on the log residual \(\log R_y - \log\widehat{R}_y\) without letting it generate recruitment, which is how several AFSC templates treat a weakly determined relationship: it informs the recruitment series rather than dictating it. Underrec_model = "bh_rec"or"ricker_rec"the curve already generates recruitment and this must stay"none".- sr_pen_sigma
Numeric standard deviation of that residual.
- sr_pen_yrs
Vector of years the stock-recruit penalty applies over, or
NULL(default) for every year that has a lagged spawning biomass, i.e. all but the firstrec_lag. Years outside it keep their recruitment deviation estimated but contribute nothing to the penalty, which is how a restricted stock-recruit window is expressed. Naming a year with no lagged spawning biomass is an error rather than a silent fallback to the equilibrium.- sr_R0_spec
Character.
"shared"(default) reusesln_global_R0, which under mean recruitment is the recruitment level, as the curve's scale, giving one scale parameter."est"gives the curve its own estimatedln_sr_R0, identified by the curve fit itself."rinit"takes the scale fromln_rinit, the initial equilibrium recruitment, so one parameter sets both the unfished age structure and the curve; it requiresuse_rinit = 1."shared"is the better posed of the first two;"est"reproduces templates that have separate mean-recruitment and unfished-recruitment parameters, and"rinit"reproduces those that use the unfished recruitment in both places, which is the usual ADMB arrangement.- h_spec
Character or
NULL. Sharing structure for stock-recruit steepnesssteepness_h[n_pop x n_regions], parameterized in bounded logit space \((0.2, 1)\). DefaultNULL(estimate by population whenn_pop > 1, by region whenn_pop = 1). Ignored whenrec_model = "mean_rec". Seedo_h_mappingfor full option descriptions.- sgl_seas_spawning_movement
Spawning movement array
[n_pop x n_regions x n_regions x n_years x n_ages x n_sexes]. Each[p, , r, y, a, s]slice is a row-stochastic movement matrix giving the probability of fish from each origin region spawning in regionr. IfNA(default), 100% natal homing is assumed and the array is constructed internally.- t_spawn
Numeric. Spawn timing as a fraction of the season elapsed before spawning.
0(default) = spawning before any mortality;1= spawning after all mortality.- stray_rate_spec
Character string. Estimation structure for
stray_rate_pars[n_pop x max_stray_blocks], parameterized on the logit scale. Ignored whenuse_fixed_stray_rate = 1orn_pop = 1. Default"fix". Options:"fix"All parameters fixed at starting values (mapped to
NA). Use this alongsideuse_fixed_stray_rate = 0to hold stray rates at a specified value without estimating."est_all"Estimate independently per population x block. Produces one parameter per population per unique block.
"est_shared_pop"Single parameter per block, shared across all populations. Requires identical block structures across all populations. An error is raised if block indices differ.
- stray_rate_blocks
Character vector of length
n_popdefining the temporal block structure for stray rate parameters. Valid formats:"none_Pop_x"Constant stray rate for population
xacross all years (single block)."Block_k_Year_a-b_Pop_x"Block
kapplies to yearsathroughbfor populationx. Use"terminal"in place of the end year to extend through the final model year.
Default: a single constant block for every population. Note: stray rate is generally unidentifiable from fisheries data alone. Time-blocking is provided for completeness but regularization via
use_stray_rate_priorin the penalty setup is strongly recommended wheneverstray_rate_spec != "fix".- use_fixed_stray_rate
Integer (0/1). Whether stray rates are supplied as a fixed external array (
fixed_stray_rate) rather than estimated as model parameters. Default1(fixed), preserving existing behavior. Set to0to estimate stray rates viastray_rate_pars.- fixed_stray_rate
Array
[n_pop x n_years]. Fixed stray rate values used whenuse_fixed_stray_rate = 1. Values should be in \([0, 1]\). Default:0(no straying) for all populations and years. Ignored whenuse_fixed_stray_rate = 0.- use_stray_rate_prior
Integer (0/1). Whether Beta priors are applied to estimated stray rate parameters. Only relevant when
use_fixed_stray_rate = 0andn_pop > 1. An error is raised ifuse_stray_rate_prior = 1alongsideuse_fixed_stray_rate = 1sincestray_rate_parswould not be estimated. Default0.- stray_rate_prior
Data frame of Beta prior parameters for stray rates. Required columns:
pop(population index),block(block index matchingstray_rate_blocks),mu(prior mean, in \((0,1)\)),sd(prior standard deviation). One row per population x block combination to penalize. Ignored whenuse_stray_rate_prior = 0. DefaultNULL.- spawn_seas
Integer. Season index in which spawning occurs. Default
1.- sexratio_spec
Character. Estimation structure for sex ratio parameters
sexratio_pars[n_pop x n_regions x n_blocks]. Default"fix". Seedo_sexratio_pars_mappingfor full option descriptions. Must be"fix"whenn_sexes = 1.- sexratio_blocks
Character vector defining temporal block structure for sex ratio parameters. One entry per population-region combination. Valid formats:
"none_Pop_x_Region_x"Constant sex ratio for population
xand regionx(single block across all years)."Block_k_Year_a-b_Pop_x_Region_x"Block
kapplies to yearsathroughb. Use"terminal"in place of the end year to extend through the final model year.
Default: a single constant block for every population-region combination.
- use_rinit
Integer (0/1). Whether a separate initial recruitment scalar
ln_rinitis used to initialize the population independently of the recruitmentln_global_R0. When0(default),ln_rinitis fixed andln_global_R0governs both initialization and recruitment. When1, bothln_rinitandln_global_R0are estimated, withln_rinitused exclusively for equilibrium initialization andln_global_R0used for the stock-recruit relationship.Integer vector of length
n_ages - 1specifying an explicit parameter-sharing structure forln_InitDevsalong the age dimension. Each element gives the factor level assigned to that age position; positions sharing the same integer value are constrained to a single estimated parameter. Used in conjunction withequil_init_age_strc = 3("stoch_shared_ages"), which activates user-defined age sharing while still estimating deviations independently across populations and regions. The sharing structure is also respected byInitDevs_specoptions:"est_shared_r"applies the vector per population (with a population-level offset so pops remain independent), and"est_shared_pop_r"applies it globally (no offset, all pops and regions share the same parameters). A typical use case is replicating ADMB models where ages beyond the data plus group share the last estimated deviation, e.g.c(1:42, rep(42, 9))for a 52-age model with 43 data ages, giving 42 free parameters. WhenNULL(default), age sharing follows the standard behavior determined byequil_init_age_strcalone.- R0_blocks
Character vector giving time blocks for
R0, one entry per population, in the same vocabulary as the selectivity blocks:"none_Pop_<p>","Block_<b>_Year_<a>-<e>_Pop_<p>"(1-based year indices,"terminal"allowed for the end year). Underrec_model = "mean_rec"R0IS mean recruitment, so a block is a productivity regime. Under a stock-recruit form it is the curve's scale, so blocking it makes the curve time-varying:S0moves with the block, and depletion and any reference point built on the curve step at its boundary. A curve fitted as a penalty instead (sr_penaltywithsr_R0_spec = "shared") takes its scale fromR0_ref_blockand stays put. DefaultNULL, a single block.- R0_ref_block
Integer, the block whose
R0is used everywhere a single value is needed rather than a year's value: the initial age structure, the regional apportionment, theR0prior, theln_rinitpenalty and the stock-recruit scale whensr_R0_spec = "shared". Default 1. Only the recruitment computed each year uses that year's block.- use_r0_prior
Integer (0/1). Whether to apply a lognormal prior on R0 for any populations. Default 0.
- r0_prior
Data frame with columns
pop(population index),mu(prior mean on natural scale), andsd(prior SD on log scale). Required whenuse_r0_prior = 1.- Use_rinit_pen
Integer (0/1). Whether to penalize the initial equilibrium recruitment's offset from the recruitment level, \(\log(R_{init} / R_0) \sim N(0, \mathrm{rinit\_pen\_sd}^2)\), under
use_rinit = 1. An equilibrium recruitment stands for the average of several years of recruitment, so its spread is smaller than a single year's; \(\sigma_R / (1 / M - 0.5)\), with \(1/M - 0.5\) the average age of the stock, is a reasonable choice. Default 0.- rinit_pen_sd
Standard deviation of that penalty, log scale. Default 1.
- ...
Optional named starting values for parameters. Any of:
ln_global_R0[n_pop],ln_rinit[n_pop],rec_region_prop_pars[n_pop x (n_regions - 1)],rec_seas_prop_pars[n_pop x (n_seas - 1)],steepness_h[n_pop x n_regions](bounded logit scale),ln_InitDevs[n_pop x n_regions x (n_ages - 1) x n_sexes](a 3-D array is broadcast across sexes),ln_RecDevs[n_pop x n_regions x n_years],ln_sigmaR[2 x n_pop x n_regions],sexratio_pars[n_pop x n_regions x n_blocks]. Unspecified parameters use internal defaults.- ln_global_R0_spec
Character string,
"est"(default) or"fix"."fix"mapsln_global_R0off at its starting value, so the recruitment deviations hold log recruitment rather than as departures from a level. That is how SAM writes recruitment, where the first year's log numbers at age are the recruitment itself and there is no separate level parameter. The recruitment counterpart ofln_F_mean_specinSetup_Mod_Catch_and_F.Under
rec_model = "mean_rec"the level and the deviations are only both estimable when something reads the deviations' level. An"iid"or"ar1"penalty does; a random walk does not, since it penalizes only the change from one deviation to the next. Combining a walk withdont_pen_recdev_first >= 1, which removes the first year's term, leaves the two exactly unidentified, and that combination is rejected rather than fitted: it converges to a singular Hessian and standard errors ofNA. A walk with the first year still penalized is accepted with a warning, since the level is then readable only through that one term and its standard error comes back nearRecDevs_rw_init_sigma.
Value
The input input_list with all recruitment-related fields
populated in $data and $par, and factor maps constructed
in $map for: rec_region_prop_pars, rec_seas_prop_pars,
ln_sigmaR, ln_InitDevs, ln_RecDevs,
RecDevs_rho, steepness_h, sexratio_pars, and
stray_rate_pars. Character-coded inputs
for init_age_strc and equil_init_age_strc are converted to
integer codes before storage.
See also
Other Model Setup:
Setup_Mod_Biologicals(),
Setup_Mod_Catch_and_F(),
Setup_Mod_Dim(),
Setup_Mod_Discard_Comps(),
Setup_Mod_FishIdx_and_Comps(),
Setup_Mod_Fishsel_and_Q(),
Setup_Mod_Movement(),
Setup_Mod_Retsel(),
Setup_Mod_SrvIdx_and_Comps(),
Setup_Mod_Srvsel_and_Q(),
Setup_Mod_Tagging(),
Setup_Mod_Weighting()