The R package decamod was developed for doing stock assessments of New Zealand rock lobster stocks. The operating model (OM) is a length structured model coded using the R Template Model Builder (RTMB) software. MLE inference can be done using the R package nlminb and Bayesian inference can be done using a range of different R packages.
The decamod package can be installed using:
remotes::install_github(repo = "quantifish/decamod")Testing and coverage
Run the tests with testthat::test_local(). The suite includes small synthetic assessments, independent likelihood calculations, automatic-gradient checks, biological mass-balance checks, posterior-draw alignment, and MSE checkpoint tests. Synthetic fixtures do not depend on confidential assessment files.
The development target is 90% test coverage, not a claim that this has already been achieved. Run Rscript tools/check-coverage.R /tmp/decamod-coverage to measure coverage and list uncovered lines by file; add --enforce to fail below 90%. CI reports the measured percentage and uploads it to Codecov. Legacy functions and plotting code remain in the denominator. Coverage measures execution, not scientific validity; numerical and biological assertions are required as well.
