Skip to main content

Truncated Marginal Neural Ratio Estimation with an inhomogeneous poisson point process cache.

Project description

swyft

.. image:: https://badge.fury.io/py/swyft.svg :target: https://badge.fury.io/py/swyft :alt: PyPI version

.. .. image:: https://github.com/undark-lab/swyft/actions/workflows/tests.yml/badge.svg .. :target: https://github.com/undark-lab/swyft/actions .. :alt: Tests

.. .. image:: https://github.com/undark-lab/swyft/actions/workflows/syntax.yml/badge.svg .. :target: https://github.com/undark-lab/swyft/actions .. :alt: Syntax

.. image:: https://codecov.io/gh/undark-lab/swyft/branch/master/graph/badge.svg?token=E253LRJWWE :target: https://codecov.io/gh/undark-lab/swyft :alt: codecov

.. .. image:: https://readthedocs.org/projects/swyft/badge/?version=latest .. :target: https://swyft.readthedocs.io/en/latest/?badge=latest .. :alt: Documentation Status

.. .. image:: https://img.shields.io/badge/contributions-welcome-brightgreen.svg?style=flat .. :target: https://github.com/undark-lab/swyft/blob/master/CONTRIBUTING.md .. :alt: Contributions welcome

.. .. image:: https://colab.research.google.com/assets/colab-badge.svg .. :target: https://colab.research.google.com/github/undark-lab/swyft/blob/master/notebooks/Quickstart.ipynb .. :alt: colab

.. image:: https://zenodo.org/badge/DOI/10.5281/zenodo.5752734.svg :target: https://doi.org/10.5281/zenodo.5752734

swyft is the official implementation of Truncated Marginal Neural Ratio Estimation (TMNRE), a hyper-efficient, simulation-based inference technique for complex data and expensive simulators.

swyft:

  • estimates likelihood-to-evidence ratios for arbitrary marginal posteriors; they typically require fewer simulations than the corresponding joint.
  • performs targeted inference by prior truncation, combining simulation efficiency with empirical testability.
  • seamless reuses simulations drawn from previous analyses, even with different priors.
  • integrates dask <https://dask.org/>_ and zarr <https://zarr.readthedocs.io/en/stable/>_ to make complex simulation easy.

swyft is designed to solve the Bayesian inverse problem when the user has access to a simulator that stochastically maps parameters to observational data. In scientific settings, a cost-benefit analysis often favors approximating the posterior marginality; swyft provides this functionality. The package additionally implements our prior truncation technique, routines to empirically test results by estimating the expected coverage, and a dask <https://dask.org/>_ simulator manager with zarr <https://zarr.readthedocs.io/en/stable/>_ storage to simplify use with complex simulators.

Related

  • tmnre <https://github.com/bkmi/tmnre>_ is the implementation of the paper Truncated Marginal Neural Ratio Estimation <https://arxiv.org/abs/2107.01214>_.
  • v0.1.2 <https://github.com/undark-lab/swyft/releases/tag/v0.1.2>_ is the implementation of the paper Simulation-efficient marginal posterior estimation with swyft: stop wasting your precious time <https://arxiv.org/abs/2011.13951>_.
  • sbi <https://github.com/mackelab/sbi>_ is a collection of simulation-based inference methods. Unlike swyft, the repository does not include truncation nor marginal estimation of posteriors.

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

swyft-0.3.1.tar.gz (1.7 MB view details)

Uploaded Source

Built Distribution

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

swyft-0.3.1-py3-none-any.whl (69.2 kB view details)

Uploaded Python 3

File details

Details for the file swyft-0.3.1.tar.gz.

File metadata

  • Download URL: swyft-0.3.1.tar.gz
  • Upload date:
  • Size: 1.7 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.63.0 importlib-metadata/4.11.2 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10

File hashes

Hashes for swyft-0.3.1.tar.gz
Algorithm Hash digest
SHA256 3a02d61bb73f68d8b128f3bcc50c25c794885717ce851263e1f65c8101e6c98a
MD5 e77ed4bd2f2cd8bd750eac56deef473d
BLAKE2b-256 2b04cd0d998e4b9d1826f366472ee0f3b2af6adf3875e158b607a09f318aaede

See more details on using hashes here.

File details

Details for the file swyft-0.3.1-py3-none-any.whl.

File metadata

  • Download URL: swyft-0.3.1-py3-none-any.whl
  • Upload date:
  • Size: 69.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.63.0 importlib-metadata/4.11.2 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10

File hashes

Hashes for swyft-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 4a1b2f09317d95120bc8a0c20f3eab78bf752fda9457877f680e0c7116575525
MD5 71f417d14e22aa1ce8c798ce603c7ae2
BLAKE2b-256 f9faf9f31128ede74f32209ba135657b77d98b9b3a12089c0d26decb83c3c6c0

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