Skip to contents

Computes the likelihood contribution from an aerial abundance index using a multivariate normal distribution on the log scale.

Usage

get_aerial_survey_like(
  aerial_switch = 1L,
  aerial_survey,
  aerial_cov,
  first_yr,
  par_log_aerial_tau,
  par_log_aerial_sel,
  number_ysa,
  weight_fya
)

Arguments

aerial_switch

Integer switch. Zero disables the likelihood; values 1–4 activate the likelihood and select the configured age-2-to-4 selectivity pattern.

aerial_survey

A data.frame of aerial survey observations with columns Year and Index.

aerial_cov

A matrix of covariance for aerial survey observations.

first_yr

Integer first model year.

par_log_aerial_tau

Numeric log-scale additional observation-error standard deviation.

par_log_aerial_sel

Numeric log-scale selectivity parameters for ages 2 and 4 (used when aerial_switch=1).

number_ysa

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

weight_fya

A 3D array of weights-at-age with dimensions fishery by year by age.

Value

A list containing:

lp_aerial_tau

Log-determinant diagnostic. This term is already included in lp and must not be added to the objective again.

lp

Complete multivariate-normal negative log-likelihood value, or zero when aerial_switch = 0.