Implementation of Nested Sampling with Barriers
Project description
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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file barriersampling-0.0.2.tar.gz.
File metadata
- Download URL: barriersampling-0.0.2.tar.gz
- Upload date:
- Size: 8.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.11.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f594a8c41248b76d3ffb7665f6da6cc00957e0fa1562178e361a3f222f84261a
|
|
| MD5 |
1a7c9fe9f12a44e757d6244fc09609a0
|
|
| BLAKE2b-256 |
1d4d78b177024217c2662304b7adf7d8f49f877595d251005de987a1a31043a1
|
File details
Details for the file barriersampling-0.0.2-py3-none-any.whl.
File metadata
- Download URL: barriersampling-0.0.2-py3-none-any.whl
- Upload date:
- Size: 7.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.11.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
128624e4e421c995d6d1c6d7ab290129f21a58e5c68490e43e9926bc7f160529
|
|
| MD5 |
2ef5fae1864a30394913f49f1a68052f
|
|
| BLAKE2b-256 |
61e7f37d68ee8d080e4f21bba04d49081e6cd5f6b3c8ff9bb4aed89ef423f9ef
|