BayesFrag: Bayesian estimation of empirical seismic fragility functions
BayesFrag is an open-source Python library to perform Bayesian parameter estimation of empirical seismic fragility models. The methodology is presented in
Bodenmann L., Baker J.W. , Stojadinović B. (2023): "Accounting for ground motion uncertainty in empirical seismic fragility modeling", Engineering Archive [preprint], doi:10.31224/3336.
Seismic fragility functions provide a relationship between damage and a ground motion intensity measure (IM). Empirical fragility functions are estimated from damage survey data collected after past earthquakes. This is challenging, because the IM values that caused the observed damage are uncertain. BayesFrag computes the joint posterior distribution of fragility function parameters and IM values at the sites of the surveyed buildings.
To avoid any additional dependency on a specific library of ground motion models (GMMs), the GMM estimates are computed prior and separate to the fragility parameter estimation.
Getting started
To allow for a smooth start, we offer three tutorials that can be opened on a hosted Jupyter notebook service (e.g., Google Colab).
- The first tutorial reproduces the results of the one-dimensional example from the manuscript and explains the implementation of the proposed estimation approach:
- The second tutorial shows how the Bayesian approach can be applied to a realistic damage survey data set. The notebook can easily be modified and extended such that analysts can apply BayesFrag to their data sets of interest:
- The third tutorial explains the computation of the GMM estimates, which is done prior and separate to the fragility parameter estimation:
Structure
The folder bayesfrag contains the main codebase of the BayesFrag package.
The folder data contains the data used in the two tutorials.
The folder results contains the results illustrated in the manuscript.
The notebook figures.ipynb reproduces the figures shown in the manuscript using utility functions from utils_plotting.py.
The script main_aquila_casestudy.py performs all computations - from parameter estimation to post-processing - to reproduce the results presented in the paper (and stored in the folder results). This script is computationally expensive and causes high memory demand. The computations were performed on a NVIDIA V100 tensor core GPU with 25 GB of RAM and we do not recommend to run this script on a standard personal computer.
Installation
BayesFrag can be installed as
pip install bayesfrag
It is good practice to do the installation in a new virtual environment, for example with venv or with miniconda. BayesFrag was tested with Python >= v3.10.
Contact
BayesFrag is an open-source software. If you are interested in contributing to the project or have any questions, comments, or suggestions, please contact Lukas Bodenmann at bodenmann (at) ibk.baug.ethz.ch.
Acknowledgments
We gratefully acknowledge support from the ETH Risk Center ("DynaRisk", Grant Nr. 395 2018-FE-213) and from the Chair of Earthquake Engineering and Structural Dynamics at ETH Zurich.
Licence
BayesFrag is released under the BSD-3-Clause license.
Metadata
Release files for bayesfrag 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| bayesfrag-0.1.0.tar.gz | 18.5 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| bayesfrag-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 38.4 kB
Release files / bayesfrag-0.1.0.tar.gz
| Download URL | bayesfrag-0.1.0.tar.gz |
|---|---|
| Size | 18.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
62584f03df0270012b9d2ef93413a16696e0eefef55aa07f44fcf90925959ac2
|
|
BLAKE2b-256 checksum How to use checksums |
2f434dcd66922c8053795d7163f705cbd10fd1822cbda795d5eac068f40093c5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.12
|
Release files / bayesfrag-0.1.0-py3-none-any.whl
| Download URL | bayesfrag-0.1.0-py3-none-any.whl |
|---|---|
| Size | 20.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
aeeb1bc83068741479fdde08b7206ff600ec1aea9510b9f46d47a34c6b967dc9
|
|
BLAKE2b-256 checksum How to use checksums |
a320dc4da5b6b114c5373eb288f9e635a4bc194f2ca7a0c956cbe14dfcfb962b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.12
|
Security for bayesfrag 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.