This repository is provided to support transparency of the methods used in the study and to give other analysts a reproducible code base that can be inspected, rerun, and adapted. It accompanies the article Parameterisation and feasibility treatment in a Bayesian stock assessment model fitted with Hamiltonian Monte Carlo.
This repository contains:
- analysis scripts
- Stan model files
- saved results used in the study
- helper utilities
This repository does not include the manuscript source files.
analysis/: scripts for SBC and prior-only runsdata/: input data objectsmodels/: Stan model filesresults/: saved outputs used in the studyscripts/: helper scripts for manifests and sensitivity analysesutils/: shared helper functions
The saved results used in the study are already included under results/. In practice, most users will want to inspect those saved outputs rather than rerun everything locally.
- Show the available commands without starting a rerun:
make help
- Rebuild the results manifest from the saved outputs:
make collect-results
- Run the full paper workflow locally:
make
The default make target runs the full paper workflow sequentially. This can take a very long time on a local machine.
make- Run the full paper workflow locally and sequentially.
make help- Show the available commands.
make collect-results- Rebuild
results/results_manifest.rdsfrom the saved SBC outputs.
- Rebuild
make sbc- Run the full SBC grid used in the study:
eight main models under
no,0.1,0.3, and0.5. Internally this callsscripts/run_sbc_grid.sh, which loops over configurations and runssetup.Ronce per configuration.
- Run the full SBC grid used in the study:
eight main models under
make prior-only- Run the independent prior-only comparison for the main eight models. This is the paper-scale prior-only run, not the separate four-model softmax sensitivity check.
make sensitivity-softmax- Run the four-model
fmaxversussoftmaxsensitivity analysis.
- Run the four-model
make rerun-all- Run all paper analyses, then rebuild the results manifest.
For a containerised run that matches the software environment used in the original project, use:
ghcr.io/pacificcommunity/bayes:v1.5
Pull the image:
docker pull ghcr.io/pacificcommunity/bayes:v1.5Open an interactive shell in that environment:
make docker-shellRun the main analyses in Docker:
make docker-sbc
make docker-prior-only
make docker-rerun-allEquivalent direct docker run form:
docker run --rm -v "$(pwd):/work" -w /work ghcr.io/pacificcommunity/bayes:v1.5 make rerun-allThis gives a more reproducible execution environment than a local run, provided the saved results, input files, and container tag are kept fixed.
- The original study used
HTCondorto run analyses in parallel. A localmakerun executes them sequentially and can take a very long time. - The same is true for
make sbcandmake prior-onlywhen they are run on their own. fitcsv/is excluded by default because it is large and can be regenerated locally.- Saved outputs used in the study are included under
results/.