This library provides functionality to (approximatively) sample from non-trivial and high-dimensional probability measures. Prerequisites for the current implementation are that the measure is defined on [-1,1]^d and specified via a (potentially unnormalized) probability density function. In order to sample from such a distribution, we generate a polynomial approximation of the target density and then use this to construct the transport map that couples the uniform measure with the (approximate) target measure. This transport map can also be understood as a coordinate transformation that transports uniformly distributed samples towards regions of high probability under the target measure:
This library provides the implementation of the algorithm introduced in [1], together with the numerical experiments presented therein.
numpy
peewee
Basic use cases of this library for 1D and 2D test cases, as well as for a high-dimensional Bayesian Inverse Problem, can be found in the form of Jupyter notebooks in notebooks
.
Core modules of this library are:
Densities.py
This module collects several densities, such as theUniform
density,Gaussian
densities, two-dimensional geometrically shapedHat
andCircle
densities, aRosenbrock
-type density and aGaussianPosterior
density associated with a given forward operator. Several densities can be combined linearly in aMultimodalDensity
class. Further custom density classes can be implemented by deriving from the base classTargetDensity
.Surrogates.py
Contains a classLegendre
, which constructs and stores an approximation to a given target density in a Legendre polynomial basis. The approximation can be computed via classical or weighted least squares or via interpolation. The distribution of interpolation nodes can be specified.Transport.py
Given a density surrogate in a Legendre basis, this class implements the Knothe-Rosenblatt transport mapping between the uniform and the target measure.MultiIndex.py
This module providesMultiIndex
classes (a dense and sparse implementation) as well as aMultiIndexSet
class with several deriving classes that implement different types of multi-index sets (TensorProductSet
,TotalDegreeSet
andSparseSet
) and that are used to construct polynomial ansatz spaces. It further contains aMultiIndexTreeNode
andMultiIndexTree
that are used in the transport map implementation.Forward.py
This module collects forward operators, such as the convolution operator, that can be used together with theGaussianPosterior
density to express the posterior density of a Bayesian Inverse Problem.Database.py
SQLite functionalities for storing the results of larger scale runs.
In a shell, simply run pytest
in order to execute the basic unit tests in the test
directory.
If you found this library useful in your research, please consider citing the paper:
@article{westermann2025measure,
title={Measure transport via polynomial density surrogates},
author={Westermann, Josephine and Zech, Jakob},
journal={Foundations of Data Science},
year={2025},
doi={10.3934/fods.2025001},
url={https://www.aimsciences.org/article/id/67bd87d56ef6c1651cb04f04},
}