Skip to contents

Computes likelihood contributions for CPUE length compositions using age-length keys (ALKs).

Usage

get_cpue_length_like(
  lf_switch = 1L,
  cpue_years,
  cpue_lfs,
  cpue_n,
  lf_minbin,
  par_log_lf_alpha,
  number_ysa,
  sel_fya,
  alk_ysal,
  cpue_lf_sel_fishery = 7L
)

Arguments

lf_switch

Integer specifying likelihood type (1=multinomial, 2=Dirichlet, 3=Dirichlet-multinomial, 9=KL divergence).

cpue_years

A vector of year indices for each CPUE length composition observation.

cpue_lfs

A matrix of observed CPUE length composition proportions with rows as observations and columns as length bins.

cpue_n

A vector of effective sample sizes for each observation.

lf_minbin

A vector of minimum length bins. The fifth entry is used for CPUE length compositions.

par_log_lf_alpha

A vector of log-scale concentration parameters for Dirichlet likelihoods. The fifth entry is used for CPUE length compositions.

number_ysa

A 3D array of numbers-at-age with dimensions year by season by age.

sel_fya

A 3D array of selectivity values with dimensions fishery by year by age.

alk_ysal

A 4D array of age-length keys with dimensions year by season by age by length bin.

cpue_lf_sel_fishery

Integer selectivity row used for CPUE length-composition predictions. Defaults to the dedicated row 7.

Value

A numeric vector of negative log-likelihood contributions. The raw reported prediction matrix is available as cpue_lf_pred.

Details

CPUE length compositions are assumed to have already been trimmed to the CPUE domain in the input data. Therefore lf_minbin[5] is used as a lower cutoff for CPUE LFs; bins below this cutoff are discarded and the retained bins are renormalised. Unlike the catch-fishery LFs, the left tail is not aggregated into the minimum bin. The reported cpue_lf_pred matrix stores probabilities before this retained-bin renormalization, with discarded bins set to zero. Consumers that require conditional proportions must renormalize the retained bins.