Repository navigation
Workflow for updating Rceattle
Grant Adams edited this page Feb 6, 2026
·
1 revision
Model parameterization
The entire model (observation model, population model, and likelihood equations) is written on a single C++ TMB script in the src/TMB folder. See the index at the top of the C++ file for general organization. The model is ran using the fit_mod found in the R/fit_mod.R script, which calls sub functions to build the parameter object, map object, and prepare the data for estimation in TMB.
Adding a new parameter
- Add parameter to the cpp file in src/TMB
- Add parameter to the build_params.R R script in the "R" folder
- Add mapping function to build_map.R R script in the "R" folder
- Add parameter to phase to OPT-phaser.R R script in the "R" folder
- (Optional) add random effect switches to
fit_modfunction function in the fit_mod.R R script in the "R" folder - Add info on switches to meta_data_names excel doc in inst/extdata and or roxygen in
fit_mod.R
Changing data
- Change data inputs on the cpp file in src/TMB
- Update read_write_excel_data.R R script in the "R" folder
- Adjust data checks in data_check.R R script in the "R" folder
- Add data function to rearrange_data.R R script in the "R" folder if the data need to be rearranged for input into TMB
- Add info to meta_data_names excel doc in inst/extdata and/or roxygen in
fit_mod.R
Changing model likelihood
The model likelihood is coded at the end of C++ TMB script in the src/TMB folder. The likelihood components are organized in the jnll_comp object by species, fleet, and likelihood component.