Skip to contents

Computes a seasonal, age-based tag-recapture model with independent Dirichlet-multinomial likelihood components.

Usage

get_tag_like(
  tag_switch = 1L,
  minK = 59L,
  n_K = 6L,
  n_T = 6L,
  n_I = 3L,
  n_J = 7L,
  first_yr,
  M_a,
  hrate_ysa,
  tag_release_cta,
  tag_recap_ctaa,
  minI,
  maxI,
  maxJ,
  shed1,
  shed2,
  tag_rep_rates_ya,
  tag_H_factor,
  tag_var_factor = 1.82
)

Arguments

tag_switch

Integer flag to turn the likelihood on (>0) or off (0).

minK

Integer starting cohort index.

n_K

Integer number of cohorts.

n_T

Integer number of tagging time periods.

n_I

Integer number of release ages.

n_J

Integer number of recapture ages.

first_yr

Integer first model year. Retained for interface compatibility; the current implementation does not read this argument.

M_a

A vector of natural mortality rates indexed by age.

hrate_ysa

A 3D array of harvest rates with dimensions year by season by age.

tag_release_cta

A 3D array of tag release numbers with dimensions cohort by tagging period by release age.

tag_recap_ctaa

A 4D array of tag recapture numbers with dimensions cohort by tagging period by release age by recapture age.

minI

A vector of minimum release ages for each cohort.

maxI

A vector of maximum release ages for each cohort.

maxJ

A vector of maximum recapture ages for each cohort.

shed1

A vector of immediate tag shedding rates for each tagging period.

shed2

A vector of continuous tag shedding rates for each tagging period.

tag_rep_rates_ya

A matrix of tag reporting rates with dimensions year by age.

tag_H_factor

Numeric scaling factor for incomplete mixing in harvest rates (adjusts season 1 harvest).

tag_var_factor

Numeric variance-inflation factor used to derive each Dirichlet-multinomial concentration. It must be greater than 1 and smaller than the relevant release count.

Value

A numeric vector of negative log-likelihood contributions, one per active cohort, tagger group, and release-age component. Predicted recaptures are reported as tag_pred.