Skip to contents

Calculate Age-Frequency Likelihood (Version 1)

Usage

get_age_like_v1(
  af_year,
  af_fishery,
  af_min_age,
  af_max_age,
  af_obs,
  af_n,
  catch_pred_fya
)

Arguments

af_year

An integer vector, year indices for age-frequency observations.

af_fishery

An integer vector, fishery indices for observations.

af_min_age

An integer vector, minimum ages for aggregation.

af_max_age

An integer vector, maximum ages for aggregation.

af_obs

A numeric matrix of dimensions \[n_af, n_age\], observed age frequencies.

af_n

A numeric vector, sample sizes for each observation.

catch_pred_fya

A numeric array of dimensions \[n_fishery, n_year + 1, n_age\], predicted catch-at-age.

Value

A list containing:

pred

Predicted age frequencies (numeric matrix)

lp

Negative log-likelihood values (numeric vector)