Python code to derive frequency-magnitude relationships for volcanoes in Southeast Asia using Bayesian inference and model averaging. Code accompanies a forthcoming paper currently in press: https://www.frontiersin.org/articles/10.3389/feart.2022.895756/abstract.
- Pandas - Version 1.2.3
- Numpy - Version 1.20.1
- MatPlotLib - Version 3.3.4
- PyMC3 - Version 3.11.1
- Seaborn - Version 0.11.1
- SciPy - Version 1.6.0
A number of CSV files are provided with this code to conduct the analysis. Details of these are:
- Volcano_list.csv - Downloaded from Global Volcanism Program (GVP) on 04 Mar 2020
- GVPDB2019 - Downloaded from GVP on 27 Jan 2020
- Change_points_all.csv - Change points from Mead and Magill 2014.
- Whelley_SEA - Volcanoes and classification of volcano type from Whelley et al. 2015
Download the Holocene volcanoes list and eruptions database from GVP website. At present, the analysis will only run for volcanoes that are included within both the Whelley and GVP volcano list (n=173).
Note: Some modification (e.g. headers) to spreadsheets downloaded from GVP may be necessary. See example spreadsheets: "GVPDB2019.csv" and "Volcano_list.csv" for formatting guidance. Ensure that spreadsheets are named consistently in two python scripts.
- Comment out the "selected_volcanoes" variable (line 40 of "Analysis.py")
- Change the "volcanoes" variable (line 41 of "Analysis.py") to a list that contains just the GVP of the volcano of interest.
If a Bayesian update is conducted the code will take approximately 5-10 minutes to run per loop. Otherwise it will take a matter of seconds as it will only assign a prior for volcanoes with no eruption record in the GVP. So if all loops are included (i.e. full sensitivity analysis) the code will take a hours per volcano.
- Run "Analysis.py"
Note: It will take a long time to run through the entire set of volcanoes for all potential loops. It is possible the time could be reduced by changing the number of cores used in the ""FreqMagSEA.py", but PyMC3/Theano has known issues with multi-processing on Windows, so this is not currently recommended.
We provide a worked example using Merapi volcano as a case study that presents the general scientific rationale and assumptions of the approach. This worked example can be found in the associated Jupyter notebook.
- Automatically assigns a prior to volcanoes based on analogues classifications.
- Conduct a Bayesian update for volcanoes with a volcanic record.
- Model averaging for two different approaches to analogue volcano classification.
Project is: in progress
Josh Hayes
Susanna Jenkins