sbt_add_msy() runs the annual MSY calculation for an optimized
sbt_fit() and stores the complete, portable result in its msy slot.
Posterior calculations are bound to the exact retained posterior payload;
MLE calculations are bound to the fitted-model runtime identity. A matching
named calculation is reused without reevaluation. A different calculation
cannot silently replace it.
Usage
sbt_add_msy(
fit,
name = "default",
posterior = TRUE,
years = NULL,
iters = NULL,
chains = NULL,
lambda = 1e+05,
phase1_lambda = 100,
control = list(eval.max = 100000L, iter.max = 100000L),
cores = 1L,
overwrite = FALSE
)Arguments
- fit
An optimized
sbt_fit()object.- name
Non-empty storage name within
fit$msy$entries.- posterior
TRUEto use the stored posterior orFALSEto calculate MSY at the MLE.- years
Calendar catch years to evaluate.
NULLuses every fitted catch year.- iters
Optional retained-iteration indices used in every selected chain for a posterior calculation.
- chains
Optional posterior chain indices.
- lambda
Final catch-allocation penalty passed to
find_msy().- phase1_lambda
First-phase catch-allocation penalty passed to
find_msy().- control
Control list passed to
stats::nlminb().- cores
Positive integer number of forked workers.
- overwrite
If
TRUE, replace a non-matching calculation already stored undername. Matching calculations are always reused.
Details
The lower-level run_msy() function remains available for calculations
that do not belong to one fit, such as a posterior assembled from multiple
grid-cell fits.
See also
Other MSY calculations:
find_msy(),
msy_calc(),
run_msy()
Other fit workflow:
check_mcmc(),
check_mle(),
sbt_add_bounds(),
sbt_add_map(),
sbt_add_parameters(),
sbt_add_priors(),
sbt_build_object(),
sbt_example_fit(),
sbt_fit(),
sbt_fit_compatibility(),
sbt_fit_io,
sbt_fit_rebuild(),
sbt_fit_report(),
sbt_fit_validate(),
sbt_fit_validation(),
sbt_mcmc(),
sbt_obj(),
sbt_optimise()
