Set up recruitment dynamics for the operating model simulation
Source:R/setup_recruitment.R
Setup_Sim_Rec.RdSets the stock-recruit form and density dependence, \(R_0\), steepness, sex
ratio, the recruitment and initial age deviations, seasonal allocation, spawn
timing and the equilibrium initialization. Call after Setup_Sim_Dim.
Usage
Setup_Sim_Rec(
sim_list,
do_recruits_move = 0,
sexratio_input = array(if (sim_list$n_sexes == 1) 1 else 0.5, dim = c(sim_list$n_pop,
sim_list$n_regions, sim_list$n_yrs, sim_list$n_sexes, sim_list$n_sims)),
R0_input = array(15, dim = c(sim_list$n_pop, sim_list$n_regions, sim_list$n_yrs,
sim_list$n_sims)),
rinit_input = array(15, dim = c(sim_list$n_pop, sim_list$n_regions, sim_list$n_sims)),
h_input = array(0.8, dim = c(sim_list$n_pop, sim_list$n_regions, sim_list$n_yrs,
sim_list$n_sims)),
stray_rate_input = array(0, dim = c(sim_list$n_pop, sim_list$n_yrs, sim_list$n_sims)),
ln_sigmaR = array(log(1), dim = c(2, sim_list$n_pop, sim_list$n_regions)),
rec_seas_prop_input = {
rec_seas_prop = array(0, dim = c(sim_list$n_pop,
sim_list$n_seas, sim_list$n_sims))
rec_seas_prop[, 1, ] <- 1
rec_seas_prop
},
recruitment_opt = "bh_rec",
rec_dd = "global",
init_dd = "global",
use_rinit = 0,
init_age_strc = 2,
spawn_seas = 1,
t_spawn = 0,
rec_lag = 1,
SR_ref_yr = 1,
Rec_input = NULL,
ln_InitDevs_input = NULL,
ln_RecDevs_input = NULL,
InitDevs_sex_spec = "est_shared_s",
RecDevs_model = "iid",
RecDevs_rho = array(0, dim = c(sim_list$n_pop, sim_list$n_regions)),
sigmaR_switch = 1
)Arguments
- sim_list
Simulation list returned by
Setup_Sim_Dim.- do_recruits_move
Integer flag.
0(default) starts movement at age 2,1moves recruits from age 1.- sexratio_input
Proportion of recruits per sex, array
[n_pop x n_regions x n_yrs x n_sexes x n_sims]. Default1for one sex,0.5each for two.- R0_input
Unfished equilibrium recruitment array
[n_pop x n_regions x n_yrs x n_sims]. Default15.- rinit_input
Equilibrium recruitment used for initialization under
use_rinit = 1, array[n_pop x n_regions x n_sims]. Default15.- h_input
Steepness array
[n_pop x n_regions x n_yrs x n_sims], values in \((0.2, 1)\). Default0.8.- stray_rate_input
Natal-homing stray rate array
[n_pop x n_yrs x n_sims], the proportion straying from the natal region at spawning. Default0.- ln_sigmaR
Log-scale sd of the recruitment deviations, array
[2 x n_pop x n_regions], index 1 the early period and 2 the late period. The initial age deviations read index 1. Defaultlog(1). A laterSetup_Sim_DSEMthat links recruitment overwrites both indices with that series' settled value under the arrows, the same number the fit's own penalty reads. A series that never settles falls back a step: a walk reads its own sd line, and a moderated variance, having no sd line, leaves what is passed here standing.- rec_seas_prop_input
Seasonal allocation of annual recruitment, array
[n_pop x n_seas x n_sims]summing to 1 across seasons. Default all in season 1. Must be zero beforespawn_seaswhenrec_lag = 0andspawn_seas > 1.- recruitment_opt
Recruitment model, default
"bh_rec".0/"mean_rec"has no stock-recruit relationship,1/"bh_rec"is Beverton-Holt and requiresrec_dd = "local"whenn_pop > 1, and999/"resample_from_input"resamples years fromRec_input, using historical years as they are and sampling projection years with replacement so spatial covariance within a year is kept.- rec_dd
Density dependence for the stock-recruit relationship, default
"global".0/"local"gives each region its own \(R_0\) and steepness, required whenn_pop > 1under"bh_rec";1/"global"pools across regions.- init_dd
Density dependence for equilibrium initialization, same options as
rec_dd. Default"global".- use_rinit
Integer (0/1). Whether
rinit_inputinitializes the population separately fromR0_input. Under0(default)rinit_inputis ignored.- init_age_strc
Equilibrium initialization method, default
2.0/"iterative"iterates forward to approximate equilibrium,1/"scalar_no_move"is a scalar geometric series without movement,2/"matrix"is the matrix series with movement, and3/"scalar_plus_only"moves only the plus group.4/"free"projects no equilibrium:ln_InitDevsare the initial log numbers-at-age for ages 2 and above, apportioned by sex ratio, so the initial condition ignoresinit_F_parandln_rinitand any penalty becomes a prior on initial abundance.- spawn_seas
Integer index of the spawning season. Default
1.- t_spawn
Spawn timing as a fraction of
spawn_seaselapsed before spawning.0(default) spawns before any mortality,1after all of it.- rec_lag
Integer seasons between spawning and recruitment.
1(default) uses SSB from that many seasons prior, in any season.0is age-0 recruitment on the same year's SSB, so recruits may only enter inspawn_seasor later andrec_seas_prop_inputmust be zero before it.- SR_ref_yr
Integer year index supplying the biological inputs to unfished spawning biomass per recruit, and so the curve's scale. Matches the estimation model's
SR_ref_yr. Default1.- Rec_input
External recruitment array
[n_pop x n_regions x n_yrs x n_sims], required underrecruitment_opt = "resample_from_input". Projection years beyond its length are resampled from historical years with replacement. DefaultNULL.- ln_InitDevs_input
Optional log-scale initial age deviations, either
[n_pop x n_regions x (n_ages - 1) x n_sims]for one shared curve or[n_pop x n_regions x (n_ages - 1) x n_sexes x n_sims]for one per sex. Then_ages - 1dim excludes the reference age.NULL(default) draws one shared curve per population and region; pass zeros to start in equilibrium.- ln_RecDevs_input
Optional log recruitment deviations
[n_pop x n_regions x n_input_yrs x n_sims], used as given in every year they cover instead of being drawn, the years after them drawn as usual. A year thatRec_inputcovers takes its recruitment from there. DefaultNULL.- InitDevs_sex_spec
How initial age deviations are drawn across sexes when
ln_InitDevs_inputis not supplied."est_shared_s"(default) draws one curve per population or region for every sex,"est_all"draws each sex its own. Names matchSetup_Mod_Rec.- RecDevs_model
Process error the deviations are drawn under.
"iid"(default) is independent,"rw"a random walk,"ar1"reverts toward zero at rateRecDevs_rho. Year one is drawn atln_sigmaRunder the first two and fromln_sigmaR / sqrt(1 - RecDevs_rho^2)under"ar1". MatchesSetup_Mod_Rec.- RecDevs_rho
Matrix
[n_pop x n_regions]of AR1 correlations in \((-1, 1)\). Only read underRecDevs_model = "ar1". Default zero.- sigmaR_switch
Integer year index at which the recruitment deviations switch from index 1 of
ln_sigmaRto index 2, matchingSetup_Mod_Rec. Default1, which reads index 2 in every year.
Value
sim_list with $recruitment_opt, $rec_dd,
$init_dd, $R0, $h, $sexratio, $ln_sigmaR,
$rec_seas_prop, $spawn_seas, $t_spawn, $rec_lag,
$init_age_strc, $do_recruits_move, $move_age,
$stray_rate, and optionally $Rec_input,
$ln_InitDevs_input and $ln_RecDevs_input. Character codes are converted to integers before
storage.