Calculates the likelihood for observed age compositions.
Usage
get_age_like(
af_switch = 1,
removal_switch_f,
af_year,
af_fishery,
af_min_age,
af_max_age,
af_obs,
af_n,
par_log_af_alpha,
catch_pred_fya
)Arguments
- af_switch
Integer specifying likelihood type (1=multinomial, 2=Dirichlet, 3=Dirichlet-multinomial, 9=KL divergence).
- removal_switch_f
A
vectorof flags indicating whether each fishery is active (0) or inactive.- af_year
A
vectorof year indices for each age composition observation.- af_fishery
A
vectorof fishery indices for each age composition observation.- af_min_age
A
vectorof minimum ages for aggregation in each observation.- af_max_age
A
vectorof maximum ages for aggregation in each observation.- af_obs
A
matrixof observed age composition proportions with rows as observations and columns as ages.- af_n
A
vectorof effective sample sizes for each observation.- par_log_af_alpha
A
vectorof log-scale concentration parameters for Dirichlet likelihoods, indexed by fishery.- catch_pred_fya
A 3D
arrayof predicted catch with dimensions fishery by year by age.
