Set up survey selectivity and catchability specifications
Source:R/setup_survey_selectivity.R
Setup_Mod_Srvsel_and_Q.RdSets the survey selectivity forms, time blocks, continuous time variation,
process error and deviations, the catchability blocks and estimation structure,
and the selectivity and catchability priors. Call after
Setup_Mod_SrvIdx_and_Comps.
Usage
Setup_Mod_Srvsel_and_Q(
input_list,
cont_tv_srv_sel = paste("none_Fleet_", 1:input_list$data$n_srv_fleets, sep = ""),
srv_sel_blocks = paste("none_Fleet_", 1:input_list$data$n_srv_fleets, sep = ""),
srv_sel_model,
Use_srv_q_prior = 0,
srv_q_prior = NA,
srv_q_blocks = paste("none_Fleet_", 1:input_list$data$n_srv_fleets, sep = ""),
srvsel_pe_pars_spec = NULL,
srv_fixed_sel_pars_spec,
srv_q_spec = NULL,
srv_q_type = rep("est", input_list$data$n_srv_fleets),
srv_sel_devs_spec = NULL,
corr_opt_semipar = NULL,
srv_q_model = NULL,
sigma_srv_q_spec = "est_all",
srv_q_rho_spec = "est_all",
srv_q_rw_init_sigma = NA,
srv_q_re_years = NULL,
Use_srv_selex_prior = 0,
srv_selex_prior = NULL,
Use_srv_selex_penalty = 0,
srv_sel_norm_bins = NULL,
srv_sel_bin_dev_bins = NULL,
srvsel_pe_wt = rep(1, input_list$data$n_srv_fleets),
srvsel_rw_init_sigma = rep(5, input_list$data$n_srv_fleets),
cont_tv_srvsel_bin_devs = rep("none", input_list$data$n_srv_fleets),
srv_selex_penalty = NULL,
t_srv = array(1, dim = c(input_list$data$n_regions, input_list$data$n_seas,
input_list$data$n_srv_fleets)),
srvsel_devs_shared_bins = NULL,
srv_selex_type = "age",
use_fixed_srv_sel = rep(0, input_list$data$n_srv_fleets),
srv_sel_input = NULL,
srv_sel_nonpar_est_bins = NULL,
srvsel_dont_est_dev_first = rep(0, input_list$data$n_srv_fleets),
srv_sel_sex_offset = rep("none", input_list$data$n_srv_fleets),
srv_sel_dbnrml_raw = NULL,
srv_sel_dbnrml_startbin = NULL,
...
)Arguments
- input_list
Named list with
$data,$par,$mapand$verbose.$data$srv_selex_typemust already be set bySetup_Mod_Biologicals.- cont_tv_srv_sel
Character vector of continuous time variation per fleet, each
"<type>_Fleet_x":"none"(default),"iid","rw","3dmarg","3dcond"(3D GMRF over age, year and cohort) or"2dar1"(separable over bin and year). Any fleet other than"none"also needssrvsel_pe_pars_specandsrv_sel_devs_spec.- srv_sel_blocks
Character vector of discrete selectivity time blocks, each
"Block_k_Year_a-b_Fleet_x"with"terminal"allowed as the end year, or"none_Fleet_x"(default) for constant selectivity. Parsed into an[n_regions × n_years × n_srv_fleets]array. Mutually exclusive with continuous time variation for the same fleet.- srv_sel_model
Character vector of the selectivity form per fleet, and optionally per block:
"<model>_Fleet_x"or"<model>_Fleet_x_Block_k", the latter required when a fleet has several blocks. The forms and their syntax, including the"bicubic"suffixes, are those offish_sel_modelinSetup_Mod_Fishsel_and_Q. No default.- Use_srv_q_prior
Integer (0/1) for lognormal priors on survey catchability. Default
0.- srv_q_prior
Data frame with columns
region,fleet,block,muon the natural scale andsdon the log scale, one row per \(\log\text{N}(\log(\mu), \text{sd})\) prior. DefaultNA.- srv_q_blocks
Character vector of discrete catchability time blocks, in the format of
srv_sel_blocks. Parsed into an[n_regions × n_years × n_srv_fleets]array. Default"none_Fleet_x".- srvsel_pe_pars_spec
Character vector
[n_srv_fleets]orNULL(default) of the sharing structure for the process error hyperparameters. Seedo_sel_pe_pars_mapping. Deviations shared over regions or fleets insrv_sel_devs_specshare these the same way, whatever this says.- srv_fixed_sel_pars_spec
Character vector
[n_srv_fleets]of the sharing structure for the fixed-effect selectivity parameters. No default. Seedo_fixed_sel_pars_mapping.- srv_q_spec
Character vector
[n_srv_fleets]orNULL(default) of the sharing structure for catchability. Seedo_q_mapping.- srv_q_type
Character vector
[n_srv_fleets]of how catchability is obtained."est"(default) estimatesln_srv_q,"arith"concentrates it out as the ratio of mean observed to mean predicted index, and"geo"does the same on the log scale asexp(mean(log(obs) - log(pred))). Both analytic forms use the years with observations only and fix that fleet'sln_srv_qwhateversrv_q_specsays. The solve runs within eachsrv_q_blocksblock.- srv_sel_devs_spec
Character vector
[n_srv_fleets]orNULL(default) of the sharing structure for the deviation series. Seedo_sel_devs_mapping.- corr_opt_semipar
Character vector
[n_srv_fleets]orNULL(default) of which correlation components to suppress under the 3D GMRF or 2D AR1 forms. Seedo_sel_pe_pars_mapping.- srv_q_model
Character vector
[n_srv_fleets]of the process error on annual catchability deviations:"none"(default),"iid","rw","ar1"or"dsem", which passes the series toSetup_Mod_DSEM. Catchability is then \(\exp(\ln q_{r,b,f} + \epsilon_{r,y,f})\). A fleet with deviations cannot also havesrv_q_blocksor an analytically solvedsrv_q_type.- sigma_srv_q_spec
Sharing string for the deviation standard deviation over region and fleet:
"est_all"(default),"est_shared_r","est_shared_f","est_shared_r_f"or"fix".- srv_q_rho_spec
Sharing string for the AR1 correlation, with the same options as
sigma_srv_q_spec. Default"est_all". Only read undersrv_q_model = "ar1".- srv_q_rw_init_sigma
Standard deviation of the first estimated year of a random walk.
NA(default) starts the walk at zero under its own sigma, which keepsln_srv_qas the level of the series; a wide value leaves the level free and confounds it withln_srv_q.- srv_q_re_years
List
[n_srv_fleets], each element the model years (as indices intodata$years, not calendar years) that fleet's catchability deviations are estimated over, orNULLfor every year.NULL(default) gives every fleet every year. Projection years are always estimated regardless. A year left out of a fleet's vector holds that fleet's deviation fixed at zero, which a random walk or ar1 then steps through like any other fixed cell, except at that fleet's first estimated year: there a random walk gets the diffusesrv_q_rw_init_sigmastart and an ar1 its stationary marginal sd, the same treatment year one gets when nothing is fixed ahead of it. Read only for a fleet whosesrv_q_modelis not"none".- Use_srv_selex_prior
Integer (0/1) for priors on the survey selectivity parameters. Default
0.- srv_selex_prior
Data frame with columns
region,fleet,block,sex,par,mu,sdand an optionaltype."par"(the default) is a lognormal prior on one fixed selectivity parameter, withmuon the natural scale andsdon the log scale."value"is a normal prior on the realized selectivity at one bin, both on the natural scale, whereparnames the bin and the value is read at the first model year ofblock; that is the ADMB convention of pinning survey selectivity at a reference age near one, which no set of independent parameter priors can express. DefaultNULL.- Use_srv_selex_penalty
Integer (0/1). Whether a centering penalty is applied to sets of survey selectivity fixed-effect parameters. Default
0.- srv_sel_norm_bins
List with one element per fleet naming the bins the mean-one standardization averages over, or
NULLfor fleets standardizing over every bin. Read under"nonparlog"only. A gear whose catchability is defined against part of the bin range standardizes over that part, and catchability absorbs the difference in scale. DefaultNULL.- srv_sel_bin_dev_bins
List with one element per fleet naming the bins that fleet overrides, or
NULLfor none, e.g.list(1, NULL). An overridden bin takes a freely estimated annual value \(\exp(\epsilon_{y,b})\) in place of what the functional form produced, applied after every other transformation including standardization, while the rest of the curve keeps its parametric shape. DefaultNULL.- srvsel_pe_wt
Numeric vector
[n_srv_fleets]multiplying the survey selectivity process error likelihood. Default1.0skips that fleet's process error, so the deviations stay estimated but enter the objective only through the data and any smoothness or centering penalties. Values other than 0 or 1 make an estimated process error sigma reinterpretable. Applies toln_srvsel_devsonly; the bin-override deviations have their own process error.- srvsel_rw_init_sigma
Numeric vector
[n_srv_fleets]giving the standard deviation of the first year of an"rw"deviation series. Default5, which leaves that year effectively free.NAinstead starts the walk at zero under the walk's own estimated sigma, which suits a base curve that already describes the first year well.- cont_tv_srvsel_bin_devs
Character vector
[n_srv_fleets]of the process error on the bin-override deviations:"none"(default),"iid"or"rw". A walk has its own estimated sigma per bin.- srv_selex_penalty
Data frame of centering penalties with columns
region,fleet,block,sex,parandwt, required whenUse_srv_selex_penalty = 1. Each row penalizeswt * (log(mean(exp(pars))))^2over the parameters named inpar, a single index or a list column of integer vectors. This pins the scalar of a non-parametric curve that catchability would otherwise absorb, and is softer than fixing a bin. Meant for parameter sets on the log scale. DefaultNULL.- t_srv
Survey timing as a fraction of the year (annual models) or the season (seasonal models), array
[n_regions × n_seas × n_srv_fleets]. Default1, the end of the period.List of integer vectors grouping the bins that share one deviation series, e.g.
list(1:5, 6:10, 11:30). Required whensrv_sel_devs_specnames an"est_shared_b"variant. DefaultNULL.- srv_selex_type
Character scalar,
"age"(default) or"length".- use_fixed_srv_sel
Integer vector
[n_srv_fleets],1to fix survey selectivity and0to estimate it.- srv_sel_input
Array of fixed survey selectivity values
[n_pop × n_regions × n_years × n_seas × n_bins × n_sexes × n_srv_fleets], required whenever any survey has fixed selectivity.- srv_sel_nonpar_est_bins
Optional bin groupings for non-parametric survey selectivity, structured
[[survey]][[block]], each element a list of integer vectors naming the bins that share one estimated parameter. Indices are on the bin dim the survey selectivity type names.- srvsel_dont_est_dev_first
Integer vector
[n_srv_fleets]of 0/1, default0. Where1, that fleet's deviations start in year two and the fixed parameters hold year one. A non-parametric form has one free base parameter per bin, so year one's deviation is that same value written twice with onlysrvsel_rw_init_sigmabetween them, a prior on a level usually meant to be free. Refused for the GMRF and 2D AR1 forms, whose deviations are a field over years and bins rather than a walk anchored at year one.- srv_sel_sex_offset
Character vector
[n_srv_fleets]linking the sexes of a fleet's selectivity whenn_sexes > 1:"none"(default),"par","scale","par_scale","apical"or"par_apical". Seefish_sel_sex_offsetinSetup_Mod_Fishsel_and_Qfor what each one does.- srv_sel_dbnrml_raw
NULL(default) or a 0/1 matrix[n_srv_fleets x 2]for fleets on the double normal: column one leaves the ascending limb a raw Gaussian instead of anchoring it top5at the first bin, column two does the same for the descending limb andp6.- srv_sel_dbnrml_startbin
NULL(default) or an integer vector[n_srv_fleets], the bin each survey's double normal anchors its ascending limb at. Seefish_sel_dbnrml_startbininSetup_Mod_Fishsel_and_Q.- ...
Optional starting values for the selectivity and catchability parameters.
Value
input_list with the selectivity and catchability configuration in
$data (cont_tv_srv_sel, srv_sel_blocks,
srv_sel_model, srv_q_blocks, srv_q_prior,
Use_srv_q_prior, srv_q_model, Use_srv_selex_prior,
srv_selex_prior, t_srv), the starting values in $par for
srv_fixed_sel_pars, ln_srv_q, srvsel_pe_pars,
ln_srvsel_devs, ln_srv_q_devs, ln_sigma_srv_q and
srv_q_rho, and their factor maps in $map.
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_Rec(),
Setup_Mod_Retsel(),
Setup_Mod_SrvIdx_and_Comps(),
Setup_Mod_Tagging(),
Setup_Mod_Weighting()