Compute Fishing Mortality Deviation Process Error Log-Likelihood (Negative Scale)
Source:R/model_priors_penalties.R
Get_Fdev_PE_loglik.RdThe negative log-likelihood of ln_F_devs under an iid, random walk or
AR1 process. Unlike Get_PE_loglik and
Get_move_PE_loglik, which return one positive scalar for the
caller to negate, this returns an already-negated array shaped like
ln_F_devs, zero where catch is not used, matching the
Fmort_nLL reporting.
Usage
Get_Fdev_PE_loglik(
PE_model,
ln_sigmaF,
Fdev_rho,
ln_F_devs,
map_ln_F_devs,
Fdev_pen_center = 0
)Arguments
- PE_model
Integer process error structure:
1iid,2random walk with the first active year on a diffuse \(N(0, 5)\),3AR1 with the first active year drawn from its stationary marginal.- ln_sigmaF
Array
[n_regions x n_seas x n_fish_fleets]of log-scale process error sd.- Fdev_rho
Array
[n_regions x n_seas x n_fish_fleets]of unconstrained AR1 partial correlation, transformed to \((-1, 1)\) here and read underPE_model == 3only.- ln_F_devs
Array
[n_regions x n_years x n_seas x n_fish_fleets]of log-scale fishing mortality deviations.- map_ln_F_devs
Array shaped like
ln_F_devsmirroring$map$ln_F_devs: an estimation index where a deviation is estimated andNAwhere it is fixed. Only estimated deviations are penalized and they alone form the active sequence, so a fixed cell is skipped and widens the gap between the deviations either side of it.do_Fmort_mappingbuilds it from the catch use indicators, estimating a deviation wherever aggregated or population-specific catch is used, or whereObsCatchisNA, which is a missing value rather than a real closure; a recorded zero is a closure and is excluded.- Fdev_pen_center
Integer.
1centers on the deviations' own mean,0on zero.
Details
The walk and the AR1 do not need catch-active years to be contiguous: the transition between two active years is taken over the elapsed gap between them, which is the same marginal as estimating deviations for the closed years and integrating them out, and reduces to the single-step transition when the gap is one year.