Projects per year
Abstract / Description of output
lintsampler provides a Python implementation of a technique we term ‘linear interpolant
sampling’: an algorithm to efficiently draw pseudo-random samples from an arbitrary probability density function (PDF). First, the PDF is evaluated on a grid-like structure. Then, it is assumed that the PDF can be approximated between grid vertices by the (multidimensional) linear interpolant. With this assumption, random samples can be efficiently drawn via inverse
transform sampling (Devroye, 1986). lintsampler is primarily written with numpy (Harris et al., 2020), drawing some additional functionality from scipy (Virtanen et al., 2020). Under the most basic usage of lintsampler, the user provides a Python function defining the target PDF and some parameters describing a grid-like structure to the LintSampler class, and is then able to draw samples via the sample method. Additionally, there is functionality for the user to set the random seed, employ quasi-Monte Carlo sampling, or sample within a premade grid (DensityGrid) or tree (DensityTree) structure.
sampling’: an algorithm to efficiently draw pseudo-random samples from an arbitrary probability density function (PDF). First, the PDF is evaluated on a grid-like structure. Then, it is assumed that the PDF can be approximated between grid vertices by the (multidimensional) linear interpolant. With this assumption, random samples can be efficiently drawn via inverse
transform sampling (Devroye, 1986). lintsampler is primarily written with numpy (Harris et al., 2020), drawing some additional functionality from scipy (Virtanen et al., 2020). Under the most basic usage of lintsampler, the user provides a Python function defining the target PDF and some parameters describing a grid-like structure to the LintSampler class, and is then able to draw samples via the sample method. Additionally, there is functionality for the user to set the random seed, employ quasi-Monte Carlo sampling, or sample within a premade grid (DensityGrid) or tree (DensityTree) structure.
Original language | English |
---|---|
Article number | 6906 |
Pages (from-to) | 1-5 |
Number of pages | 5 |
Journal | The Journal of Open Source Software |
Volume | 9 |
Issue number | 102 |
DOIs | |
Publication status | Published - 1 Oct 2024 |
Fingerprint
Dive into the research topics of 'lintsampler: Easy random sampling via linear interpolation'. Together they form a unique fingerprint.Projects
- 2 Active
-
-
Dark Matter dynamics in the Milky Way and Large Magellanic Cloud
Petersen, M.
Engineering and Physical Sciences Research Council
1/04/22 → 31/03/26
Project: Research