Skip to contents

Computes the negative log-likelihood for tag-recapture data using a seasonal, age-based model with beta-binomial distribution.

Usage

get_tag_like(
  tag_switch = 1,
  minK,
  n_K,
  n_T,
  n_I,
  n_J,
  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.

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 overdispersion factor for beta-binomial distribution (default = 1.82).

Value

A list containing:

pred

4D array of predicted tag recaptures.

resid

4D array of standardized residuals.

lp

Vector of negative log-likelihood contributions for each independent likelihood component.