Skip to contents

These constructors store immutable specifications; they do not fit a model. em_spm() distinguishes the original CRA2 specification (estimated process SD, initial value 0.001, unguarded transitions) from the guarded toy specification (process SD fixed at 0.10). The original specification retains the original finite-estimate acceptance policy, including non-converged fits. The toy specification requires convergence and no final positivity guards.

Usage

em_spm(
  config = c("cra2_original", "toy_fixed", "toy_recalibrated"),
  reference_years,
  cpue_creep = 0.01,
  process_sd = NULL,
  recalibration = NULL,
  control = NULL,
  recalibration_target = NULL
)

em_gp(
  model,
  reference_years,
  catch_component = "legal",
  id = "single_year_gp",
  target = NULL
)

em_function(predict, target, id, settings = list())

Arguments

config

SPM specification: "cra2_original", "toy_fixed", or "toy_recalibrated".

reference_years

Explicit historical years defining relative biomass.

cpue_creep

Proportional linear creep per observation in each series.

process_sd

Optional process SD: a start for the original specification, or a fixed value for the toy specifications.

recalibration

Named numeric vector with intercept and slope for the status-preserving log-scale recalibration. Required for toy_recalibrated.

control

Optional nlminb controls.

recalibration_target

Optional mse_target() describing the response used to train the recalibration. It changes metadata, not coefficients.

model

A fitted single-year GP object, including its scaler and matrices.

catch_component

Catch series name in observations. The historical toy GP used "legal" (commercial plus recreational), while the SPM used "total" (all modelled catch components). Choose this explicitly for new training.

id

Human-readable identifier.

target

List with quantity, unit, season, and reference_years.

predict

Function (observations, state, config) returning a list with status, fit_success, optional diagnostics, and optionally updated state. It must use only observations and its explicit configuration, not OM truth.

settings

Explicit configuration for a custom estimation function.

Value

An object inheriting from decamod_em.

Details

em_gp() uses a frozen saved model in the format produced by the CRA2 single-year GP experiments. Training is deliberately outside the annual loop. Its estimate is the posterior median on the original response scale, and its intervals include the fitted nugget, as in the existing experimental code. The optional package emulator is needed only for GP prediction.