Skip to contents

Loops through surveys, calculates signed NLL for each, and aggregates the results.

Usage

calculate_and_aggregate_likelihood(
  surveys,
  G,
  a,
  l,
  mu,
  kappa,
  annuli_date,
  annuli_min_age
)

Arguments

surveys

A data frame with survey age-at-length observations with columns survey_date, Length, K, and count.

G

Greens function matrix (rows = ages, cols = length classes).

a

Numeric vector of high-resolution ages corresponding to rows of G.

l

Numeric vector of lengths corresponding to columns of G.

mu

Mean spawning date as a fraction of a year in [0, 1).

kappa

Spawning concentration parameter.

annuli_date

Ring formation day as fraction of a year in [0, 1).

annuli_min_age

Minimum age (years) at which the first ring can form.

Value

A data frame containing, for each observed Length-K bin in each survey, the observed count, expected count under the model, model probability, sample size, negative log-likelihood contribution, and signed negative log-likelihood contribution.