Skip to contents

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

Usage

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

Arguments

hsp_switch

Integer flag for likelihood type: 0=off, 1=binomial, 2=beta-binomial.

hsp_obs

A data.frame of half-sibling pair observations.

hsp_false_negative

Numeric multiplicative detection or retention factor applied to each predicted HSP probability. Despite the historical name, the supplied value is not subtracted from one.

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.

hsp_od

Numeric positive concentration parameter for the beta-binomial likelihood (default = 50).

Value

A list containing:

hsp_prob

Vector of predicted half-sibling pairing probabilities.

lp

Vector of negative log-likelihood contributions for each observation.