Set up total and retained fishery selectivity and catchability specifications
Setup_Mod_Fishsel_and_Q.RdConfigures all aspects of fishery selectivity and catchability for the
estimation model: functional forms, time blocks, continuous time-varying
structures, process error hyperparameters, annual deviations, and
catchability blocks and estimation structure. Must be called after
Setup_Mod_FishIdx_and_Comps.
Usage
Setup_Mod_Fishsel_and_Q(
input_list,
cont_tv_fish_sel = paste("none_Fleet_", 1:input_list$data$n_fish_fleets, sep = ""),
fish_sel_blocks = paste("none_Fleet_", 1:input_list$data$n_fish_fleets, sep = ""),
fish_sel_model,
Use_fish_q_prior = 0,
fish_q_prior = NA,
fish_q_blocks = paste("none_Fleet_", 1:input_list$data$n_fish_fleets, sep = ""),
fishsel_pe_pars_spec = NULL,
fish_fixed_sel_pars_spec = NULL,
fish_q_spec = NULL,
fish_sel_devs_spec = NULL,
corr_opt_semipar = NULL,
Use_fish_selex_prior = 0,
fish_selex_prior = NULL,
cont_tv_fish_sel_penalty = TRUE,
fishsel_devs_shared_bins = NULL,
fish_selex_type = "age",
use_fixed_fish_sel = rep(0, input_list$data$n_fish_fleets),
fish_sel_input = NULL,
fish_sel_nonpar_est_bins = NULL,
cont_tv_ret_sel = paste("none_Fleet_", 1:input_list$data$n_fish_fleets, sep = ""),
ret_sel_blocks = paste("none_Fleet_", 1:input_list$data$n_fish_fleets, sep = ""),
ret_sel_model = paste("logist1_Fleet_", 1:input_list$data$n_fish_fleets, sep = ""),
retsel_pe_pars_spec = NULL,
ret_fixed_sel_pars_spec = rep("fix_ret_sel_input", input_list$data$n_fish_fleets),
ret_sel_devs_spec = NULL,
ret_sel_corr_opt_semipar = NULL,
Use_ret_selex_prior = 0,
ret_selex_prior = NULL,
cont_tv_ret_sel_penalty = TRUE,
retsel_devs_shared_bins = NULL,
ret_selex_type = "age",
use_fixed_ret_sel = rep(1, input_list$data$n_fish_fleets),
ret_sel_input = array(1, dim = c(input_list$data$n_pop, input_list$data$n_regions,
length(input_list$data$years), input_list$data$n_seas, length(input_list$data$ages),
input_list$data$n_sexes, input_list$data$n_fish_fleets)),
ret_sel_nonpar_est_bins = NULL,
...
)Arguments
- input_list
Named list with
$data,$par,$map, and$verbosesublists.- cont_tv_fish_sel
Character vector of length
n_fish_fleetsspecifying continuous time-varying selectivity per fleet. Each element must be"<type>_Fleet_<f>". Valid types:"none"No continuous time-variation (default).
"iid"IID annual deviations on selectivity parameters.
"rw"Random walk in selectivity parameters over time.
"3dmarg"3D GMRF with marginal variance parameterisation.
"3dcond"3D GMRF with conditional variance parameterisation.
"2dar1"2D separable AR1 in bin and year dimensions.
If any fleet has
cont_tv_fish_sel != "none", bothfishsel_pe_pars_specandfish_sel_devs_specmust also be provided.- fish_sel_blocks
Character vector defining discrete selectivity time blocks per fleet. Each element follows
"Block_<b>_Year_<s>-<e>_Fleet_<f>"or"Block_<b>_Year_<s>-terminal_Fleet_<f>". Use"none_Fleet_<f>"(default) for a single constant block. Blocks must be non-overlapping and together span all model years for the specified fleet. Mutually exclusive withcont_tv_fish_sel != "none"for the same fleet.- fish_sel_model
Character vector specifying the selectivity functional form for each fleet (and optionally each time block). Each element must follow one of:
"<model>_Fleet_<f>"— single form for all years of fleetf."<model>_Fleet_<f>_Block_<b>"— form specific to blockbof fleetf, as defined infish_sel_blocks.
Available models:
"logist1"Logistic with \(a_{50}\) and slope \(k\) (2 parameters).
"logist2"Logistic with \(a_{50}\) and \(a_{95}\) (2 parameters).
"gamma"Dome-shaped gamma with \(a_{max}\) and \(\delta\) (2 parameters).
"exponential"Exponential with a single power parameter (1 parameter).
"dbnrml"Double-normal with 6 parameters.
"nonpar"Non-parametric selectivity defined over discrete age or length bins, where selectivity is estimated as independent parameters (or grouped bins if specified via nonparametric bin mapping). No fixed functional form is imposed.
"asymplogist1"Logistic selectivity with \(a_{50}\) and slope \(k\) and asymptotic control (3 parameters).
"asymplogist2"Logistic selectivity with with \(a_{50}\) and \(a_{95}\) and asymptotic control (3 parameters).
"bicubic"Bicubic spline over a bin-node x year-node grid (see
Get_Selex,Selex_Model == 8). Specified as"bicubic_Bin_<n_bin_nodes>_Yr_<n_yr_nodes>_Fleet_x"(optionally with_Block_k). One generalized form covers a smooth bin x year surface (n_yr_nodes > 1), a time-invariant bin-only spline (n_yr_nodes == 1), or a bin-only spline re-fit independently per year-block (n_yr_nodes == 1within each of several blocks defined viafish_sel_blocks). An optional_SelStyr_<year>suffix (a calendar year within the block) restricts the actual spline fit toSelStyr:block-end; years within the block beforeSelStyrare held constant at theSelStyryear's fitted curve, rather than fitting the surface over the whole block. An optional_NSelBins_<n>suffix restricts the actual spline fit to the firstnbins (ages or lengths, perfish_selex_type); bins beyondnare held constant at the last fitted bin's curve.
See the model equations vignette for mathematical definitions.
- Use_fish_q_prior
Integer flag.
1= apply lognormal priors to catchability;0= no priors (default). Requiresfish_q_prior.- fish_q_prior
Data frame of catchability prior hyperparameters. Required columns:
region,fleet,block(block index),mu(prior mean on natural scale),sd(prior SD on log scale). Each row specifies a \(\text{Normal}(\log(\mu), \sigma)\) prior for one catchability parameter. Only used whenUse_fish_q_prior = 1.- fish_q_blocks
Character vector defining catchability time blocks per fleet, using the same format as
fish_sel_blocks. Default"none_Fleet_<f>"gives a single constant block.- fishsel_pe_pars_spec
Character vector of length
n_fish_fleetsspecifying the estimation structure for selectivity process error hyperparameters. Required when any fleet has continuous time-variation. Seedo_fishsel_pe_pars_mappingfor all options.- fish_fixed_sel_pars_spec
Character vector of length
n_fish_fleetsspecifying how fixed-effect selectivity parameters are estimated. Seedo_fish_fixed_sel_pars_mappingfor all options ("est_all","est_shared_r","est_shared_s","est_shared_r_s","est_shared_f_x","fix").- fish_q_spec
Character vector of length
n_fish_fleetsspecifying catchability estimation structure. Seedo_fish_q_mappingfor options ("est_all","est_shared_r","fix").- fish_sel_devs_spec
Character vector of length
n_fish_fleetsspecifying the estimation structure for annual selectivity deviations. Required when any fleet has continuous time-variation. Seedo_fishsel_devs_mappingfor all options including age-sharing options for semi-parametric forms.- corr_opt_semipar
Character vector of length
n_fish_fleetscontrolling which correlation components to suppress in semi-parametric (3D GMRF or 2D AR1) time-varying selectivity. Set toNA(default) for no suppression. Seedo_fishsel_pe_pars_mappingfor valid suppression codes. Cohort-correlation options are invalid for"2dar1".- Use_fish_selex_prior
Integer flag.
1= apply lognormal priors to selectivity parameters;0= no priors (default). Requiresfish_selex_prior.- fish_selex_prior
Data frame of selectivity prior hyperparameters. Required columns:
region,fleet,block,sex,par(parameter index within the functional form),mu,sd. Only used whenUse_fish_selex_prior = 1.- cont_tv_fish_sel_penalty
Logical. If
TRUE(default), applies a penalty on the continuous time-varying selectivity deviations to regularise the process.List of integer vectors grouping age or length bins that share a single deviation series. Only used when
fish_sel_devs_speccontains one of the"est_shared_b"variants. Example:list(1:5, 6:10, 11:30).- fish_selex_type
Character scalar specifying whether selectivity is age- or length-based. Options:
"age"Selectivity is defined over age bins.
"length"Selectivity is defined over length bins.
Determines the bin dimension used for all fishery selectivity functions, including parametric, time-varying, and non-parametric forms.
- use_fixed_fish_sel
Integer vector of length
n_fish_fleetsindicating whether fishery selectivity is fixed (1) or estimated (0) for each fleet.- fish_sel_input
Array of fixed fishery selectivity values with dimensions:
[n_pop × n_regions × n_years × n_seas × n_bins × n_sexes × n_fish_fleets]. Required when any element ofuse_fixed_fish_sel == 1.- fish_sel_nonpar_est_bins
Optional list defining bin groupings for non-parametric fishery selectivity. Structure is
[[fleet]][[block]], where each element is a list of integer vectors. Each vector defines a group of bins that share a single estimated selectivity parameter. Indices must correspond to the bin dimension defined byfish_selex_type.- cont_tv_ret_sel
Character vector of length
n_fish_fleetsspecifying continuous time-varying selectivity per fleet. Each element must be"<type>_Fleet_<f>". Valid types:"none"No continuous time-variation (default).
"iid"IID annual deviations on selectivity parameters.
"rw"Random walk in selectivity parameters over time.
"3dmarg"3D GMRF with marginal variance parameterisation.
"3dcond"3D GMRF with conditional variance parameterisation.
"2dar1"2D separable AR1 in bin and year dimensions.
If any fleet has
cont_tv_ret_sel != "none", bothretsel_pe_pars_specandret_sel_devs_specmust also be provided.- ret_sel_blocks
Character vector defining discrete selectivity time blocks per fleet. Each element follows
"Block_<b>_Year_<s>-<e>_Fleet_<f>"or"Block_<b>_Year_<s>-terminal_Fleet_<f>". Use"none_Fleet_<f>"(default) for a single constant block. Blocks must be non-overlapping and together span all model years for the specified fleet. Mutually exclusive withcont_tv_ret_sel != "none"for the same fleet.- ret_sel_model
Character vector specifying the selectivity functional form for each fleet (and optionally each time block). Each element must follow one of:
"<model>_Fleet_<f>"— single form for all years of fleetf."<model>_Fleet_<f>_Block_<b>"— form specific to blockbof fleetf, as defined inret_sel_blocks.
Available models:
"logist1"Logistic with \(a_{50}\) and slope \(k\) (2 parameters).
"logist2"Logistic with \(a_{50}\) and \(a_{95}\) (2 parameters).
"gamma"Dome-shaped gamma with \(a_{max}\) and \(\delta\) (2 parameters).
"exponential"Exponential with a single power parameter (1 parameter).
"dbnrml"Double-normal with 6 parameters.
"nonpar"Non-parametric selectivity defined over discrete age or length bins, where selectivity is estimated as independent parameters (or grouped bins if specified via nonparametric bin mapping). No fixed functional form is imposed.
"asymplogist1"Logistic selectivity with \(a_{50}\) and slope \(k\) and asymptotic control (3 parameters).
"asymplogist2"Logistic selectivity with with \(a_{50}\) and \(a_{95}\) and asymptotic control (3 parameters).
See the model equations vignette for mathematical definitions.
- retsel_pe_pars_spec
Character vector of length
n_fish_fleetsspecifying the estimation structure for selectivity process error hyperparameters. Required when any fleet has continuous time-variation. Seedo_retsel_pe_pars_mappingfor all options.- ret_fixed_sel_pars_spec
Character vector of length
n_fish_fleetsspecifying how fixed-effect selectivity parameters are estimated. Seedo_ret_fixed_sel_pars_mappingfor all options ("est_all","est_shared_r","est_shared_s","est_shared_r_s","est_shared_f_x","fix").- ret_sel_devs_spec
Character vector of length
n_fish_fleetsspecifying the estimation structure for annual selectivity deviations. Required when any fleet has continuous time-variation. Seedo_retsel_devs_mappingfor all options including age-sharing options for semi-parametric forms.- ret_sel_corr_opt_semipar
Character vector of length
n_fish_fleetscontrolling which correlation components to suppress in semi-parametric (3D GMRF or 2D AR1) time-varying selectivity. Set toNA(default) for no suppression. Seedo_retsel_pe_pars_mappingfor valid suppression codes. Cohort-correlation options are invalid for"2dar1".- Use_ret_selex_prior
Integer flag.
1= apply lognormal priors to selectivity parameters;0= no priors (default). Requiresret_selex_prior.- ret_selex_prior
Data frame of selectivity prior hyperparameters. Required columns:
region,fleet,block,sex,par,mu,sd.- cont_tv_ret_sel_penalty
Logical. If
TRUE(default), applies a penalty on the continuous time-varying selectivity deviations to regularise the process.List of integer vectors grouping age or length bins that share a single deviation series. Only used when
ret_sel_devs_speccontains one of the"est_shared_b"variants. Example:list(1:5, 6:10, 11:30).- ret_selex_type
Character scalar specifying whether retained selectivity is age- or length-based. Options:
"age"Selectivity is defined over age bins.
"length"Selectivity is defined over length bins.
Determines the bin dimension used for all retained selectivity functions, including parametric, time-varying, and non-parametric forms.
- use_fixed_ret_sel
Integer vector of length
n_fish_fleetsindicating whether to fix selectivity (1) or estimate it (0).- ret_sel_input
Array of fixed selectivity values with dimensions
[n_pop × n_regions × n_years × n_seas × n_bins × n_sexes × n_fish_fleets].- ret_sel_nonpar_est_bins
Optional list specifying bin groupings for non-parametric retained selectivity. Structure is
[[fleet]][[block]], where each element is a list of bin index vectors defining grouped parameters.- ...
Optional starting value overrides for selectivity parameters.
Value
The input input_list with $data, $par, and
$map updated. Key additions include the parsed integer arrays for
cont_tv_fish_sel, fish_sel_blocks, fish_sel_model, and
fish_q_blocks; starting value arrays for all four parameter groups;
and their corresponding factor maps.
Details
Selectivity time-variation and blocked selectivity are mutually exclusive within a fleet — specifying both for the same fleet will raise an error.
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_Movement(),
Setup_Mod_Rec(),
Setup_Mod_Retsel(),
Setup_Mod_SrvIdx_and_Comps(),
Setup_Mod_Srvsel_and_Q(),
Setup_Mod_Tagging(),
Setup_Mod_Weighting()