The lack of versatile tools for Bayesian inference presents a significant challenge to researchers in geophysics, who often resort to developing bespoke codes to address specific classes of inverse problems. In this study, we present BayesBay, a Python package for generalized transdimensional and hierarchical Markov chain Monte Carlo sampling. Leveraging object‐oriented programming principles, BayesBay facilitates the definition of Bayesian sampling problems across a range of applications. This includes joint inversions of multiple data sets with different forward functions and unknown noise properties, as well as complex parameterizations involving multiple parameters with unknown dimensionality and/or spatially varying priors. We illustrate BayesBay from both a technical and a practical perspective. The first two applications are common in geophysics: a 2D tomographic problem and a joint inversion for the 1D subsurface structure. The third involves partition modeling and requires a sophisticated parameterization with two nested levels of transdimensionality. In all cases, BayesBay recovers known solutions, highlighting its potential to address a broad range of inverse problems.

You do not have access to this content, please speak to your institutional administrator if you feel you should have access.