Set up conventional tagging dynamics for the operating model simulation
Source:R/setup_tagging.R
Setup_Sim_Tagging.RdSets the release cohorts, release platform, tagging timing, tag-induced
mortality, chronic shedding, the recapture likelihood and reporting rates, and
allocates the recapture containers. Call after Setup_Sim_Dim.
Usage
Setup_Sim_Tagging(
sim_list,
n_tags = NULL,
n_tags_rel_input = NULL,
use_conv_fish_tagging = 0,
conv_tag_max_liberty = sim_list$n_ages/2,
conv_tag_release_indicator = expand.grid(regions = 1:sim_list$n_regions, tag_years =
1:sim_list$n_yrs, tag_seas = 1:sim_list$n_seas),
conv_tag_release_platform = default_tag_release_platform(conv_tag_release_indicator),
conv_tag_t_tagging = 1,
ln_init_conv_tag_mort = -1000,
ln_conv_tag_shed = -1000,
conv_fish_tag_attr = "p_a_s",
conv_tag_fish_reporting_input = array(0.5, dim = c(sim_list$n_regions, sim_list$n_yrs,
sim_list$n_fish_fleets, sim_list$n_sims)),
conv_fish_tag_like = 0,
ln_conv_fish_tag_theta = log(1),
conv_tag_pop_pool = NULL,
conv_tag_age_pool = NULL,
conv_tag_sex_pool = NULL,
conv_tagged_fish_input = NULL
)Arguments
- sim_list
Simulation list returned by
Setup_Sim_Dim.Constant number of tags released per release event. Cannot be given alongside
n_tags_rel_input. DefaultNULL.Array of cohort-specific release numbers, overriding
n_tagsand not given alongside it. DefaultNULL.- use_conv_fish_tagging
Integer (0/1) for whether fishery tag recaptures are simulated. Default
0.- conv_tag_max_liberty
Integer maximum years at liberty tracked per cohort, which sizes the recapture containers. Default
n_ages / 2.- conv_tag_release_indicator
Data frame of release cohorts with columns
regions,tag_yearsandtag_seas. Default every combination of the region, year and season insim_list.- conv_tag_release_platform
Character matrix
[n_conv_tag_cohorts × 2]of the release platform and fleet index per cohort, aligned row by row withconv_tag_release_indicator."population"releases tags into the population independently of any sampling process, withfleetset toNA;"fishery"and"survey"release them through the fleet thefleetcolumn names. Default"survey"with fleet1.- conv_tag_t_tagging
Numeric scalar or vector
[n_tag_rel_events]in \([0, 1]\), the fraction of the season remaining at release:1the start of the season,0.5mid-season,0the end. A scalar is recycled. Default1.- ln_init_conv_tag_mort
Log-scale tag-induced mortality applied at release, a scalar or a vector
[n_tag_rel_events]with a scalar recycled. Default-1000, effectively none.- ln_conv_tag_shed
Log-scale annual chronic shedding rate, a scalar or a vector
[n_tag_rel_events]with a scalar recycled. Default-1000, effectively none.- conv_fish_tag_attr
Character scalar or vector
[n_tag_rel_events]naming which dims are resolved at release and so kept at recapture, built from"p"(population),"a"(age) and"s"(sex) joined by underscores:"p_a_s"(default),"a_s","p_a","p_s","a","s","p"or"none". A scalar is recycled; a vector lets events resolve different dims. Region and fleet are always kept.- conv_tag_fish_reporting_input
Fishery reporting rate array
[n_regions × n_yrs × n_fish_fleets × n_sims]in \([0, 1]\), the probability a recaptured tag is reported. Default0.5.- conv_fish_tag_like
Tag recapture likelihood:
0/"Poisson"(default),1/"NegBin",2/"Multinomial_Release",3/"Multinomial_Recapture",4/"Dirichlet-Multinomial_Release"or5/"Dirichlet-Multinomial_Recapture".- ln_conv_fish_tag_theta
Log-scale overdispersion for the negative binomial and the two Dirichlet-multinomial likelihoods, ignored by the others. Default
log(1).- conv_tag_pop_pool, conv_tag_age_pool, conv_tag_sex_pool
Lists of integer vectors grouping populations, ages and sexes whose recaptures the estimation model fits as one count, as in
Setup_Mod_Tagging. A negative binomial is drawn once per group, since a sum of negative binomials is not the negative binomial the pooled count is fit with.NULL(default) is one group per level.- conv_tagged_fish_input
Released tags by event, population, age and sex
[n_tag_rel_events × n_pop × n_ages × n_sexes], the estimation model'sconv_tagged_fish. An event given here is released exactly so, and one leftNAis spread over populations, ages and sexes by the release platform's selected abundance as before.simulation_self_testandcondition_closed_loop_simulationspass the fit's releases, so the tags at liberty are the ones the fit followed. DefaultNULL.
Value
sim_list with the tagging fields appended: $n_tags or
$n_tags_rel_input, $conv_tag_max_liberty,
$conv_tag_t_tagging, $ln_init_conv_tag_mort and
$ln_conv_tag_shed (each of length n_tag_rel_events),
$conv_tag_release_indicator, $conv_tag_release_platform,
$n_tag_rel_events, $use_conv_fish_tagging,
$conv_fish_tag_like, $conv_fish_tag_attr,
$ln_conv_fish_tag_theta and $conv_tag_fish_reporting, plus the
zero-filled $conv_tagged_fish, $conv_tagged_fish_attr,
$conv_tag_fish_avail, $obs_conv_tag_fish_recap and
$pred_conv_tag_fish_recap.