Code to accompany Combining chains of Bayesian models with Markov melding
- The code for the little owls example is in
scripts/owsl-example/
, and code for the respiratory failure example is inscripts/mimic-example/
. - Re-running the code requires MIMIC-III with all the standard derived concept tables on a Postgres database, running and available at the connection give in these three files.
- The first time you rerun the analysis you may need to uncomment and run the
CREATE OR REPLACE
commands at the top ofblood-gasses.sql
.
- The first time you rerun the analysis you may need to uncomment and run the
- The R package dependencies are managed by
renv
. Some of the packages are not available on CRAN and are my own forks (the BA template is a fork ofrticles
that I haven't had the time to submit a PR for), butrenv
should install the correct versions. - The analysis is handled by
GNU Make
, and you will need the latest version (>= 4.3) to runmake
.- Running
make
with-j 2
or higher will parallelise much of the computation. The MCMC samplers run 5 parallel chains, so ensure you have at least 5 times the number of CPU cores as the requested number ofMake
jobs.
- Running
- I think some parts of the analysis assume certain folders exist but don't necessarily check that they do indeed exist.
The MCMC diagnostic plots and tables referred to in the text can be found here for the little owls example and here for the MIMIC respiratory failure example.
You will need to download the .html
files and open them in a browser to view the diagnostics.
If you rerun the analyses then the .html
files will need to be regenerated from their corresponding .rmd
source. This takes about an hour.