Skip to main content

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

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)

Source distribution for barriersampling 0.0.2
File Size Uploaded Provenance
barriersampling-0.0.2.tar.gz 8.6 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for barriersampling 0.0.2
File Interpreter ABI Platform
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.

Release history Release notifications | RSS feed

This release

0.0.2 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page