Barrier Sampling
This package implements Nested Sampling with Barriers as introduced in my thesis (which is included in the GitHub repository).
It lets you do Bayesian statistical inference on generative models. See also the original Nested Sampling paper by Skilling [1].
Usage
To use this algorithm, you need to implement:
- the model's loglikelihood and prior PDF
- a function generating samples from the prior
- (if using HMC for LRPS) the model's loglikelihood and prior log-PDF in jax
See the example folder for usage samples, and take a look at the docstrings in barriersampler.py for more detailed information.
Likelihood-Restricted Prior Sampling
As a modified version of Nested Sampling [1], this algorithm needs to do likelihood-restricted prior sampling. For LRPS, two methods have been implemented:
- the Metropolis algorithm [2]
- Hamiltonian Monte Carlo [3]
If you want to implement your own method of LRPS, I suggest forking this repository, adding a new method to the BarrierSampler class, and registering it in get_sampling_method.
References
- [1] John Skilling. "Nested sampling for general Bayesian computation." Bayesian Analysis 1 (4) 833 - 859, 2006. https://doi.org/10.1214/06-BA127
- [2] Nicholas Metropolis, Arianna W. Rosenbluth, Marshall N. Rosenbluth, Augusta H. Teller, Edward Teller. "Equation of State Calculations by Fast Computing Machines." The Journal of Chemical Physics 21 (6) 1087–1092, 1953. https://pubs.aip.org/aip/jcp/article-abstract/21/6/1087/202680/Equation-of-State-Calculations-by-Fast-Computing
- [3] Simon Duane, A.D. Kennedy, Brian J. Pendleton, Duncan Roweth. "Hybrid Monte Carlo." Physics Letters B 195 (2) 216-222, 1987. https://doi.org/10.1016/0370-2693(87)91197-X
Metadata
Release files for barriersampling 0.0.2
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 | |
|---|---|---|---|---|
| barriersampling-0.0.2.tar.gz | 8.6 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| barriersampling-0.0.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 16.4 kB
Release files / barriersampling-0.0.2.tar.gz
| Download URL | barriersampling-0.0.2.tar.gz |
|---|---|
| Size | 8.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f594a8c41248b76d3ffb7665f6da6cc00957e0fa1562178e361a3f222f84261a
|
|
BLAKE2b-256 checksum How to use checksums |
1d4d78b177024217c2662304b7adf7d8f49f877595d251005de987a1a31043a1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.0.1 CPython/3.11.8
|
Release files / barriersampling-0.0.2-py3-none-any.whl
| Download URL | barriersampling-0.0.2-py3-none-any.whl |
|---|---|
| Size | 7.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
128624e4e421c995d6d1c6d7ab290129f21a58e5c68490e43e9926bc7f160529
|
|
BLAKE2b-256 checksum How to use checksums |
61e7f37d68ee8d080e4f21bba04d49081e6cd5f6b3c8ff9bb4aed89ef423f9ef
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.0.1 CPython/3.11.8
|
Security for barriersampling 0.0.2
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.