Extract Index Fit Results
get_idx_fits.RdGenerates a tidy dataframe of observed and predicted survey and fishery
indices from a fitted RTMB model, including standard errors, confidence
intervals, residuals, and catchability blocks. Both pooled and
population-specific indices are returned when the corresponding
Use*_pop flags contain any ones.
Arguments
- data
List. Input data used in the RTMB model. Must contain
ObsSrvIdx,ObsSrvIdx_SE,ObsFishIdx,ObsFishIdx_SE,Wt_SrvIdx,Wt_FishIdx,srv_q_blocks,fish_q_blocks,UseFishIdx, andUseSrvIdx. For population-specific indices, also requiresObsSrvIdx_pop,ObsSrvIdx_pop_SE,ObsFishIdx_pop,ObsFishIdx_pop_SE,Wt_SrvIdx_pop,Wt_FishIdx_pop,UseSrvIdx_pop, andUseFishIdx_pop.- rep
List. RTMB report output containing
PredSrvIdxandPredFishIdx, both dimensioned[n_pop × n_regions × n_years × n_seas × n_fleets]. Pooled indices are obtained by summing across the population dimension; population-specific indices use each population slice directly.- year_labs
Vector. Year labels assigned to the year dimension of predicted and observed index arrays.
Value
A dataframe containing pooled and, when active, population-specific survey and fishery indices with the following columns:
RegionRegion label (prefixed with
"Region").YearYear.
SeasSeason.
FleetFleet identifier.
TypeOne of
"Survey","Fishery","Pop Survey", or"Pop Fishery".obsObserved index value.
valuePredicted index value.
seStandard error of the observed index (weight-adjusted).
lci,uci95% log-normal confidence interval for the observed index.
q_blockCatchability block identifier.
residLog-scale residual (\(\log(\text{obs}) - \log(\text{predicted})\)).
CategoryCombined label of Type, population (for pop rows), Fleet, Season, and Q-block.
Examples
if (FALSE) { # \dontrun{
idx_fits <- get_idx_fits(
data = data,
rep = rep,
year_labs = seq(1960, 2024, 1)
)
} # }