Skip to main content

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

barriersampling-0.0.2.tar.gz (8.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

barriersampling-0.0.2-py3-none-any.whl (7.8 kB view details)

Uploaded Python 3

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

Hashes for barriersampling-0.0.2.tar.gz
Algorithm Hash digest
SHA256 f594a8c41248b76d3ffb7665f6da6cc00957e0fa1562178e361a3f222f84261a
MD5 1a7c9fe9f12a44e757d6244fc09609a0
BLAKE2b-256 1d4d78b177024217c2662304b7adf7d8f49f877595d251005de987a1a31043a1

See more details on using hashes here.

File details

Details for the file barriersampling-0.0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for barriersampling-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 128624e4e421c995d6d1c6d7ab290129f21a58e5c68490e43e9926bc7f160529
MD5 2ef5fae1864a30394913f49f1a68052f
BLAKE2b-256 61e7f37d68ee8d080e4f21bba04d49081e6cd5f6b3c8ff9bb4aed89ef423f9ef

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page