Tephra inversion with Tephra2 and the Metropolis-Hastings algorithm

By Qingyuan Yang1, E Bruce Pitman2, Marcus I Bursik2, Susanna Jenkins1

1. Earth Observatory of Singapore 2. University at Buffalo, SUNY (UB)

Download (ZIP)

Licensed according to this deed.

Published on


We couple the Metropolis-Hastings algorithm (Hastings, 1970) with the volcanic ash transport model Tephra2 (Bonadonna et al, 2005; 2010), and present the coupled algorithm as a new method to estimate the Eruption Source Parameters (ESPs) of volcanic eruptions based on mass per unit area measurements of tephra fall deposits.

Main advantages of the algorithm are that it could incorporate prior knowledge into the estimates, and the estimates are presented as posterior probability distributions instead of estimated ESPs as single values. Thanks to these features, the algorithm has the ability to quantify the uncertainty in the estimates in a statistically formal manner. See more on the theory and implementation of the Metropolis-Hastings algorithm in Chib and Greenberg (1995), Andrieu et al (2003), and Kaipio and Somersalo (2006).

Inputs of the algorithm include prior distributions, starting values, and draw scales of the proposal functions (standard deviations of Gaussian distributions in the present version of the algorithm) for the ESPs to be estimated. Users need to declare values of the known ESPs. In addition, the number of draws for the algorithm and scale of the likelihood function (which characterizes measurement uncertainty) need to be specified. 

Outputs of the algorithm include the sampled chain (main results), log(posterior probability density) for each proposed sample, log(prior probability density) for each proposed sample, log(likelihood) for each proposed sample, and the number of accepted draws. 

The algorithm is coded in python scripts. To run it, users need to download the zipped file, which includes several sub-directories, such as "./codes", "./input", "./running_tephra2", and etc. We strongly recommend users to read the "README.txt" file carefully to run the algorithm properly. 

We hope that the algorithm could benefit studies on tephra inversion.
The paper introducing this algorithm can be found in Journal of Applied Volcanology (https://appliedvolc.biomedcentral.com/articles/10.1186/s13617-020-00101-4). 


Q: How to use the code with the version of tephra2 that is compiled from my own machine? 
A: Assume that ./ is the current address, which includes all the unzipped algorithm-related files downloaded from vhub.

Solution 1:

a. Users could copy and paste all the tephra2 source codes compiled from their own computer in the path "./src", and make sure that tephra2 (or tephra2-2012, or its name on the computer) is in that directory. 

b. Open the file "./running_tephra2/jobs_wcf.sh", and edit the bold part in line 2:
"../src/tephra2 ../running_tephra2/config.txt ../running_tephra2/sites.csv ../running_tephra2/wind.txt > ../running_tephra2/a_t2_output.txt"
Users need to change "tephra2" to the name of the version of tephra2 (e.g. "tephra2-2012") that is compiled on their computers.

Solution 2: 
a. Open the file "./running_tephra2/jobs_wcf.sh", and edit the bold part in line 2:
"../src/tephra2 ../running_tephra2/config.txt ../running_tephra2/sites.csv ../running_tephra2/wind.txt > ../running_tephra2/a_t2_output.txt"
Users need to change "../src/tephra2" to "where tephra2 is stored/" + "the name of tephra2 on the computer", and this should not be relative path. 
Example: "/home/eruption/models/tephra2_model/tephra2-2012"

Q: Got a "Permission denied" error
A: this is because the code "jobs_wcf.sh" is not executable. Users could use the following line in the command line to make it executable:
"chmod 755 /where/the/code/is/stored/jobs_wcf.sh"

   Andrieu, Christophe, et al. "An introduction to MCMC for machine learning." Machine learning 50.1-2 (2003): 5-43.
   Bonadonna, Costanza, et al. "Probabilistic modeling of tephra dispersal: Hazard assessment of a multiphase rhyolitic eruption at Tarawera, New Zealand." Journal of Geophysical Research: Solid Earth 110.B3 (2005).
   Bonadonna, Costanza, et al. "Tephra2." (2010).
   Chib, Siddhartha, and Edward Greenberg. "Understanding the metropolis-hastings algorithm." The american statistician 49.4 (1995): 327-335. 
   Hastings, W. Keith. "Monte Carlo sampling methods using Markov chains and their applications." (1970): 97-109.
   Kaipio, Jari, and Erkki Somersalo. Statistical and computational inverse problems. Vol. 160. Springer Science & Business Media, 2006.

Cite this work

Researchers should cite this work as follows:

  • Qingyuan Yang; E Bruce Pitman; Marcus I Bursik; Susanna Jenkins (2020), "Tephra inversion with Tephra2 and the Metropolis-Hastings algorithm," https://vhub.org/resources/4614.

    BibTex | EndNote