Skip to contents

Computes the negative log-likelihood for half-sibling pair observations based on reproduction and survival.

Usage

get_HSP_like(
  hsp_switch = 1,
  hsp_obs,
  hsp_false_negative,
  first_yr,
  par_log_hsp_q,
  number_ysa,
  phi_ya,
  M_a,
  spawning_biomass_y,
  hrate_ysa
)

Arguments

hsp_switch

Integer flag for activation (0=off, 1=on).

hsp_obs

A data.frame of half-sibling pair observations.

hsp_false_negative

Numeric false negative rate for half-sibling pair detection.

first_yr

Integer first model year.

par_log_hsp_q

Numeric log-scale effective sampling fraction of potential parents.

number_ysa

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

phi_ya

A matrix of reproductive output-at-age with dimensions year by age.

M_a

A vector of natural mortality rates indexed by age.

spawning_biomass_y

A vector of spawning biomass values indexed by year.

hrate_ysa

A 3D array of harvest rates with dimensions year by season by age.

Value

A list containing:

hsp_prob

Vector of predicted half-sibling pairing probabilities.

lp

Vector of negative log-likelihood contributions for each observation.