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 this 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.1.tar.gz (8.5 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.1-py3-none-any.whl (7.8 kB view details)

Uploaded Python 3

File details

Details for the file barriersampling-0.0.1.tar.gz.

File metadata

  • Download URL: barriersampling-0.0.1.tar.gz
  • Upload date:
  • Size: 8.5 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.1.tar.gz
Algorithm Hash digest
SHA256 eac5243098507c643d0aa6cf87c212e0c7c6a60a94e1290b8f388b69ba6e41c1
MD5 c960c37316394217f53b4b04d68271bc
BLAKE2b-256 c4f8adf3d32621bfead3ab0669368c13675a30e683e8835e00d6c5cf1c289b1a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for barriersampling-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 5eca581baaea261351a3deb44575a61a77d06435b711ea70c9dbeaef6a972b63
MD5 99ab96004a594ef7c9ac7d1e69d81a4f
BLAKE2b-256 ae9380a8956c887ccdebcaa50717a2de4d6b4a6f88f43d9b56647444289dc978

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