Assessment reporting tables from one or more Rceattle fits
Source:R/6-report_tables.R
report_tables.RdCollects the quantities a stock assessment reports into one set
of tidy tables, so a SAFE chapter or a model comparison comes from a single
call rather than a dozen ad-hoc extractions. Every table holds a model
column, so passing several fits gives a like-for-like comparison.
Usage
report_tables(
object,
model_names = NULL,
retro = NULL,
jitter = NULL,
osa = NULL,
ci_level = 0.95,
quantities = c("biomass", "ssb", "R", "biomass_depletion", "ssb_depletion", "F_spp")
)Arguments
- object
An Rceattle fit from
fit_mod(), or a list of them.- model_names
Names for the models, defaulting to the names of
objector toModel_1,Model_2, ...- retro
A
retrospective()result per model, orNULL(default) to omit that section.- jitter
A
jitter()result per model, orNULL(default) to omit that section.- osa
An
osa_residuals()result per model, summarized here withosa_diagnostics(), orNULL(default) to omit that section.- ci_level
Confidence level for the
timeseriesinterval, default0.95.- quantities
Time-series quantities to include, from the set
as.data.frame.Rceattle()accepts;quantity_dictionary()says what each one means.
Value
A list of data frames with class "rceattle_report", one per section
above, each holding a model column.
Details
The sections follow the AFSC Alaska Groundfish Stock Assessment Guidelines for what a chapter reports:
modelOne row per fit: dimensions, switches, the marginal and joint negative log-likelihoods, estimated parameter count, AIC, maximum gradient, whether the Hessian was positive definite, and run time.
parametersEvery estimated parameter with its standard error and its natural-scale name and process from
parameter_dictionary(), which is wheresigma_Rand an estimated M are found. Estimates are on the parameter's own scale, so alog_name needsexp(). A fixed M is absent, never having been estimated: read it offM_at_age.likelihoodNegative log-likelihood by component and fleet or species, weighted and unweighted.
timeseriesBiomass, female spawning-stock biomass, recruitment, depletion and fishing mortality by species and year, with standard errors and intervals, split into hindcast (
era = "time") and projection (era = "fore").reference_pointsThe executive-summary quantities: SPR-based F proxies, unfished and target female spawning-stock biomass, the biomass proxies implied by
Ptarget/Plimit, and terminal status. Abasiscolumn says whether each was estimated, and if not why.fitsObserved against predicted index and catch, with the standard deviation of normalized residuals (SDNR) per fleet.
retrospective,jitter,osaPresent only when the corresponding object is supplied.
Nothing here refits: the three diagnostics are tens to hundreds of
optimizations each, so they are passed in already computed, and a section
whose object is NULL is absent from the result.
The standard harvest scenarios of guideline section 4.11.3 are not
produced; they need a standard projection module, which Rceattle does not
have. Projected biomass under the model's own control rule is in
timeseries at era = "fore".
Reference points a fit never estimated come back as NA, with the reason
in basis. The reported array leaves a plausible number in each, which
is how a wrong figure reaches an executive summary:
Ftarget/Flimitare estimated only under a control rule that defines them, and are off for a species with no projected fishery or with fixed numbers-at-age. Unestimated, they sit atexp(0) = 1, reading as an F of 1.0/yr.SB0/B0undermsmMode > 0come from theMSSB0/MSB0inputs, which hold a placeholder untilfit_mod()derives them from a no-fishing projection.B_targetandB_limitare fractions ofSB0and go with it.The per-recruit quantities (
SPR0,SPRtarget,SPRlimit) are computed only undermsmMode = 0.
The depletions are not blanked alongside SB0: under a no-fishing
control rule in multispecies mode the model divides by last-projection-year
biomass, the equilibrated unfished reference, so the series is meaningful.
Two negative log-likelihoods
model reports both, and both are minimized, so smaller is the better
fit. marginal_nll is what the optimizer minimized, random effects
integrated out by Laplace, and is what AIC is built from. joint_nll is
what the template evaluated at the conditional modes, so it is what
likelihood sums to, on the same scale as jnll_comp. They are equal when
n_random is 0 and differ by the Laplace correction otherwise.
Supplying diagnostics for several models
A diagnostics list is matched to models by name, so
list(alt = ..., base = ...) pairs correctly whatever the order. An unnamed
list is paired positionally, with a message. A name that is not a model name
is an error, which catches passing one model's osa_residuals() result
stored as a list of parts.
See also
quantity_dictionary() for what each quantity means and its units,
as.data.frame.Rceattle() for the time series alone, and
standard_output() to relabel the result into the NOAA standardized
assessment output that stockplotr and asar consume.