This repository contains supporting code for the paper:
Mingo, D. N., Nijzink, R., Ley, C., and Hale, J. S.: Selecting a conceptual hydrological model using Bayes' factors computed with Replica Exchange Hamiltonian Monte Carlo and Thermodynamic Integration, EGUsphere [preprint], https://doi.org/10.5194/egusphere-2023-2865, 2024.
This code is archived at:
Mingo, N. D. and Hale, J. S.: Selecting a conceptual hydrological model using Bayes’ factors, https://doi.org/10.5281/zenodo.10202093, 2023.
This code is licensed under the GNU Lesser General Public License version 3 or
later, see COPYING
and COPYING.LESSER
.
Some studies were executed on the University of Luxembourg HPC systems. The
launch scripts are specific to that cluster and are included in the
hpc_scripts/
subdirectory for reference. It would be necessary to modify
these job launch scripts to run these studies on another cluster.
The primary dependencies are JAX and Tensorflow Probability (using the JAX backend). Secondary dependencies for pre and post-processing include various plotting and statistical libraries.
The code is compatible with Python 3.10 and the dependencies specified in the
requirements.txt
file:
pip install -r requirements.txt
The file requirements-not-fixed.txt
contains the same dependencies without
fixed version requirements.
The folder megala_creek_australia/
contains the raw data for the Magala Creek
catchment in text format. A script prepare_megala_creek_data.py
places the
data into a Pandas dataframe saved at megala_creek_australia.pkl.gz
for
straightforward ingestion into the main scripts. Note that the dataset contains
missing values on some days.
This folder contains scripts for the Gaussian shell examples.
For a basic plot using the proposed algorithm, run:
python3 gaussian_shell.py
The folder experiment_one/
contains codes for the first experiment where
the calibration data is generated from a forward run of model two.
- Generate data by executing
generate_data.py
. - For the marginal likelihood calculation execute
twobuckets.py
,threebuckets.py
andfourbuckets.py
. - The subfolder
ppc/
contains codes for the posterior predictive checks. - The results can be transferred for post-processing in which cases the
scripts are in the root
post_processing/
folder.
The folder experiment_two/
contains codes for the second experiment where
the calibration data is generated from a forward run of model three.
- Generate data by executing
generate_data.py
. - For the marginal likelihood calculation execute
twobuckets.py
,threebuckets.py
andfourbuckets.py
. - The subfolder
ppc/
contains codes for the posterior predictive checks. - The results can be transferred for post-processing in which case the
script is in the root
postprocess/
folder.
The folder real_world/
contains codes for the third experiment where the
models are calibrated and assessed against real data from Magala Creek.
The folder postprocess/
contains scripts for generating posterior plots and
chain convergence diagnostics from the results produced in experiments one, two
and three.