Skip to main content

nessai-bilby

Interface and plugin for using nessai in bilby.

This plugin provides two samplers that can be used in bilby:

  • nessai: the standard nested sampler from nessai
  • inessai: the importance nested sampler from nessai

It also provides a means to use bilby likelihoods and priors directly in nessai, see using bilby likelihoods in nessai

Installation

The package can be installed using pip

pip install nessai-bilby

or conda

conda install conda-forge::nessai-bilby

However, we recommend following installing PyTorch manually to ensure the correct device support.

Note: this plugin requires "bilby>=2.3.0".

Usage

In bilby

One nessai-bilby is installed, both samplers can be used directly in bilby via the run_sampler function. See the bilby documentation for more details on how to run different samplers.

Using bilby likelihoods in nessai

nessai-bilby also provides two model classes that allow bilby likelihood and priors to be used directly with nessai:

  • nessai_bilby.model.BilbyModel:
  • nessai_bilby.model.BilbyModelLikelihoodConstraint:

Either model can be used by creating an instance of the model and running nessai as usual:

from nessai.flowsampler import FlowSampler
from nessai_bilby.model import BilbyModel

likelihood = ...    # bilby likelihood object
priors = ... # bilby PriorDict

model = BilbyModel(
    priors=priors,
    likelihood=likelihood,
    use_ratio=True    # Whether to use the log-likelihood ratio
)

fs = FlowSampler(
    model,
    ...,
)

fs.run()

Citing

If you use nessai-bilby, please cite the nessai and bilby code bases and the corresponding papers.

Download files

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

Source Distribution

nessai_bilby-0.1.0.tar.gz (11.4 kB view details)

Uploaded Source

Built Distribution

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

nessai_bilby-0.1.0-py3-none-any.whl (7.8 kB view details)

Uploaded Python 3

File details

Details for the file nessai_bilby-0.1.0.tar.gz.

File metadata

  • Download URL: nessai_bilby-0.1.0.tar.gz
  • Upload date:
  • Size: 11.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.0.0 CPython/3.12.3

File hashes

Hashes for nessai_bilby-0.1.0.tar.gz
Algorithm Hash digest
SHA256 c71725d799543f7ba23d788389a8795361a491e25f7af5e714eecaf9e306bc2e
MD5 dcbc710635f7198fc5207442dbed60c3
BLAKE2b-256 40b12dd34abcd46488062bc92a31af0f9c31af64199675e14850b3af4957e011

See more details on using hashes here.

File details

Details for the file nessai_bilby-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: nessai_bilby-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 7.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.0.0 CPython/3.12.3

File hashes

Hashes for nessai_bilby-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 cced0862e555c8cd993101a168d4b33afc3e1855aa37d239544be908d1d71e7b
MD5 f4b991152b6bdf776c2ef324351c73e5
BLAKE2b-256 fc49cbcecd3652375e2c42d9984b46734757920541e5a137d3fb2119125cd43e

See more details on using hashes here.

Release history Release notifications | RSS feed

0.3.1

2 files

0.3.0

2 files

0.2.2

2 files

0.2.1

2 files

0.2.0

2 files

0.1.0.post0

2 files

This release

0.1.0 This release

2 files

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