Skip to content

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

  1. Add parameter to the cpp file in src/TMB
  2. Add parameter to the build_params.R R script in the "R" folder
  3. Add mapping function to build_map.R R script in the "R" folder
  4. Add parameter to phase to OPT-phaser.R R script in the "R" folder
  5. (Optional) add random effect switches to fit_mod function function in the fit_mod.R R script in the "R" folder
  6. Add info on switches to meta_data_names excel doc in inst/extdata and or roxygen in fit_mod.R

Changing data

  1. Change data inputs on the cpp file in src/TMB
  2. Update read_write_excel_data.R R script in the "R" folder
  3. Adjust data checks in data_check.R R script in the "R" folder
  4. Add data function to rearrange_data.R R script in the "R" folder if the data need to be rearranged for input into TMB
  5. 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.

Clone this wiki locally