Skip to contents

Simulated example

Public simulated model data and its fitted maximum-likelihood example.

sbt_example_data()
Load the bundled simulated SBT assessment data
sbt_example_simulate()
Simulate the bundled public SBT example
sbt_example_fit()
Load the bundled simulated SBT maximum-likelihood fit

Saved model fits

Functions for saving, validating, sharing, and rebuilding fitted models.

sbt_fit()
Create a staged, portable SBT model fit
sbt_add_parameters()
Add or override SBT model parameters
sbt_add_priors()
Add SBT model priors
sbt_add_map()
Add an RTMB parameter map
sbt_add_bounds()
Add optimizer bounds
sbt_add_random()
Add an RTMB random-effect specification
sbt_add_makeadfun_args()
Add extra RTMB MakeADFun arguments
sbt_build_object()
Build the RTMB objective for an SBT fit
sbt_optimise()
Optimise a staged SBT fit
sbt_add_optimisation()
Attach an existing optimization result to a staged SBT fit
sbt_mcmc()
Run MCMC for a staged SBT fit
sbt_add_mcmc()
Attach an existing MCMC result to an SBT fit
sbt_add_msy()
Add MSY calculations to an SBT fit
sbt_obj()
Access the runtime objective for a portable SBT fit
sbt_fit_report()
Recreate the fitted model report
sbt_fit_validation()
Inspect an embedded SBT fit-validation record
sbt_fit_validate()
Validate a portable SBT fit
sbt_fit_compatibility()
Check whether an SBT fit can be rebuilt by the current package
sbt_fit_save() sbt_fit_read()
Save and read portable SBT fits
sbt_fit_rebuild()
Rebuild an RTMB object from a portable SBT fit
sbt_fit_upgrade()
Explicitly upgrade an older SBT fit
as_tmbfit()
Convert stored posterior draws to a SparseNUTS-style fit
add_posterior_summaries()
Add posterior report summaries to an SBT fit
get_posterior_summary()
Extract an embedded posterior summary

Functions

Functions for model building, fitting, and inference.

check_abundance()
Check abundance outputs
check_bounds()
Check if parameters are up against the bounds
check_estimability()
Check for identifiability of fixed effects
check_mcmc()
Check a fitted SBT posterior
check_mle()
Check a fitted SBT maximum-likelihood estimate
check_sliced()
Check sliced age frequencies used by direct removals
cmb()
Bind the data argument of a two-argument function
do_dynamics()
Population dynamics
biological_state_contract()
Biological-state acceptance contract
biological_state_passes()
Test whether biological-state diagnostics pass
diagnose_sbt_states()
Diagnose biological states over an MLE or posterior
evaluate_priors()
Evaluate priors
expand_parameter_names()
Expand repeated RTMB parameter names
extract_fixed()
Extract fixed effects
find_msy()
Find MSY for one prepared model state
get_aerial_survey_like()
Aerial survey likelihood
get_age_like()
Age composition likelihood
get_bounds()
Get default parameter bounds
get_cpue_length_like()
CPUE length composition likelihood
get_cpue_like()
CPUE index likelihood
get_data()
Prepare SBT assessment model data
get_dl()
Obtain dl
get_GT_like()
Genetic tagging likelihood
get_harvest_rate()
Harvest rate calculation
get_harvest_wall_penalty()
Smooth preventive harvest-wall contribution
get_HSP_like()
Half-sibling pair likelihood
get_initial_numbers()
Initial numbers and Beverton-Holt parameters
get_length_at_age()
Obtain the length at age array
get_length_like()
Length Composition Likelihood
get_loo()
Obtain the leave-one-out information criterion (LOO IC)
get_M_length()
Natural mortality at length
get_M()
Natural mortality at age
get_map()
Get default parameter mapping
get_parameters()
Get default initial parameter values
get_phi()
Spawning output-at-age
get_POP_like()
Parent-Offspring Pairing Likelihood
get_posterior()
Obtain samples from the posterior distribution of reported quantities
get_priors()
Get priors
get_recruitment()
Calculate recruitment
get_recruitment_prior()
Recruitment prior
get_rho()
Estimate temporal autocorrelation in recruitment deviations
get_sel_list()
Get list of selectivity parameters
get_selectivity()
Compute selectivity-at-age by year
get_selectivity_prior()
Selectivity prior
get_sliced_afs()
Obtain sliced age frequencies from length frequencies
get_tag_like()
Tag-recapture likelihood
get_troll_like()
Troll CPUE likelihood
get_weight_at_age()
Obtain the mean weight at age
make_parameter_table()
Make a table of estimated model parameters
mar()
Median of the absolute residual (MAR)
msy_calc()
Equilibrium MSY for the SBT fishery structure
run_msy()
Run annual MSY over an SBT posterior
pairs_rtmb()
Pair plots for RTMB MCMC fits
posfun()
Positive Constraint Penalty Function
priors_to_math()
Convert prior specifications to LaTeX equations
repair_af_slices_weighted()
Repair empty sliced AFs for catch slices.
harvest_wall_contract()
Preventive harvest-wall contract
sbt_globals()
Functions required by the SBT RTMB objective
sbt_model()
Southern bluefin tuna assessment objective
sbtprofile()
Adaptive likelihood profiling
sdnr()
Standard deviation of the normalised residual (SDNR)
summarise_biological_state()
Summarise biological feasibility of one model report
sel_rho_to_par() sel_rho_from_par()
Transform selectivity autocorrelation parameters

Plots

Functions for visualising model outputs.

plot_aerial()
Plot aerial survey fit
plot_aerial_residuals()
Plot aerial survey residuals
plot_af()
Plot age frequency
plot_af_residuals()
Plot age-composition OSA residuals
plot_biomass_spawning()
Plot total reproductive output
plot_catch()
Plot catch
plot_cpue()
Plot CPUE
plot_cpue_residuals()
Plot CPUE residuals
plot_dist_length_at_age()
Plot the distribution of length at age
plot_gt()
Plot gene-tagging (GT) matches
plot_gt_residuals()
Plot GT residuals
plot_hrate()
Plot harvest rate
plot_hsps()
Plot close-kin match fits
plot_hsps_residuals()
Plot HSP residuals
plot_initial_numbers()
Plot initial numbers
plot_length_at_age()
Plot length at age
plot_levs()
Plot LEV grid posterior pairs
plot_lf()
Plot LF
plot_lf_residuals()
Plot length-composition OSA residuals
plot_loo()
Plot PSIS LOO
plot_natural_mortality()
Plot natural mortality
plot_paly()
Plot PALY age-length probabilities
plot_pops()
Plot POP fits
plot_pops_residuals()
Plot POP residuals
plot_prior_posterior()
Plot prior and posterior distributions
plot_profile()
Plot likelihood profiles
plot_rec_devs()
Plot recruitment deviates
plot_recruitment()
Plot recruitment
plot_selectivity()
Plot selectivity
plot_sliced_afs()
Plot sliced AFs
plot_tags()
Plot tags
plot_tags_fits_pooled()
Plot pooled conventional-tag fits
plot_tags_recaptures_pooled()
Plot total conventional-tag recaptures by release year
plot_tags_residuals()
Plot tag recapture residuals
plot_troll()
Plot troll index
plot_troll_residuals()
Plot troll survey residuals
plot_weight_at_age()
Plot weight at age

Grid workflows

Current deterministic and posterior grid construction, validation, sampling, and conversion.

make_mle_grid_parameters()
Build parameter inputs for an MLE grid
run_grid()
Run a grid
summarise_mle_grid()
Summarise fitted MLE-grid cells
validate_mle_grid_state_records()
Validate saved MLE-grid state records
sample_grid()
Sample from the grid
grid_to_tmbfit()
Convert sampled grid to a tmbfit object
run_grid_mcmc()
Run a grid of MCMCs
select_balanced_grid_iters()
Select balanced rows from a combined grid sample
grid_mcmc_to_tmbfit()
Convert a grid of MCMC cells to a tmbfit object

Projections

Functions for constructing inputs, schedules, and closed-loop assessment projections.

run_projections()
Run CTP projections
project_ctp_schedule()
Build the CTP projection TAC schedule
project_rec_devs()
Project recruitment deviates
project_selectivity()
Project selectivity
extend_hsp_cohorts()
Extend HSP data set

Cape Town procedure

Public Cape Town procedure controls and the default data object.

sbt_ctp_controls() mpdat
Cape Town procedure controls and default data object

Legacy grid compatibility

Compatibility helpers for historical direct-anchor in-memory grids.

get_grid()
Set up a legacy direct-anchor grid
rerun_grid()
Run a grid again
check_grid()
Check estimability of the grid

Legacy ADMB comparison model

Functions used only by the sbt_vs_admb comparison vignette.

sbt_model_v1()
The sbt model
get_data_v1()
Set up the data input file
get_dl_v1()
Obtain dl (Version 1)
get_selectivity_v1()
Compute Selectivity-at-Age Across Years
get_aerial_survey_like_v1()
Calculate Aerial Survey Likelihood (Version 1)
get_age_like_v1()
Calculate Age-Frequency Likelihood (Version 1)
get_cpue_like_v1()
Calculate CPUE Likelihood (Version 1)
get_GT_like_v1()
Calculate Gene Tagging (GT) Likelihood (Version 1)
get_harvest_rate_v1()
Calculate Harvest Rate (Version 1)
get_HSP_like_v1()
Calculate Half-Sibling Pair (HSP) Likelihood (Version 1)
get_initial_numbers_v1()
Calculate Initial Numbers-at-Age (Version 1)
get_length_like_v1()
Calculate Length-Frequency Likelihood (Version 1)
get_M_v1()
Calculate Natural Mortality-at-Age (Version 1)
get_phi_v1()
Calculate Reproductive Output-at-Age (Version 1)
get_POP_like_v1()
Calculate POP Likelihood (Version 1)
get_recruitment_prior_v1()
Calculate Recruitment Prior (Version 1)
get_recruitment_v1()
Calculate Recruitment (Version 1)
get_rho_v1()
Calculate Autocorrelation Coefficient (Version 1)
get_sel_like_v1()
Calculate Selectivity Likelihood/Prior (Version 1)
get_tag_like_v1()
Calculate Tagging Likelihood (Version 1)
get_troll_like_v1()
Calculate Troll Survey Likelihood (Version 1)