Skip to main content

Neural Network-Boosted Importance Sampling for Bayesian Statistics

Project description

Logo

Unit Testing Status Documentation Status Code Coverage PyPI Conda License: MIT Language: Python

Nautilus is an MIT-licensed pure-Python package for Bayesian posterior and evidence estimation. It utilizes importance sampling and efficient space exploration using neural networks. Compared to traditional MCMC and Nested Sampling codes, it needs fewer likelihood calls and produces much larger posterior samples. Additionally, nautilus is highly accurate and produces Bayesian evidence estimates with percent precision.

Example

This example, sampling a 3-dimensional Gaussian, illustrates how to use nautilus.

import corner
import numpy as np
from nautilus import Prior, Sampler
from scipy.stats import multivariate_normal

prior = Prior()
for key in 'abc':
    prior.add_parameter(key)

def likelihood(param_dict):
    x = [param_dict[key] for key in 'abc']
    return multivariate_normal.logpdf(x, mean=[0.4, 0.5, 0.6], cov=0.01)

sampler = Sampler(prior, likelihood)
sampler.run(verbose=True)
points, log_w, log_l = sampler.posterior()
corner.corner(points, weights=np.exp(log_w), labels='abc')

Installation

The most recent stable version of nautilus is listed in the Python Package Index (PyPI) and can be installed via pip.

pip install nautilus-sampler

Additionally, nautilus is also on conda-forge. To install via conda use the following command.

conda install -c conda-forge nautilus-sampler

Documentation

You can find the documentation at nautilus-sampler.readthedocs.io.

Attribution

A paper describing nautilus's underlying methods and performance has been submitted for publication. A draft of the paper is available on arXiv. Please cite the paper if you find nautilus helpful in your research.

License

Nautilus is licensed under the MIT License. The logo uses an image from the Illustris Collaboration.

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

nautilus_sampler-0.7.1.tar.gz (35.8 kB view details)

Uploaded Source

Built Distribution

nautilus_sampler-0.7.1-py2.py3-none-any.whl (30.1 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file nautilus_sampler-0.7.1.tar.gz.

File metadata

  • Download URL: nautilus_sampler-0.7.1.tar.gz
  • Upload date:
  • Size: 35.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.28.2

File hashes

Hashes for nautilus_sampler-0.7.1.tar.gz
Algorithm Hash digest
SHA256 cbe1c0f262355dfcbaf306f64fb8a6ee43e2ba3effb4058b27305fe855ff5d01
MD5 4cfaf77cf33bfc82aca747ec03b0760e
BLAKE2b-256 dcd43c5377fe57acd9e82aa978b53bf9f08324c02ef29ae4c0b91dcc1074a10b

See more details on using hashes here.

File details

Details for the file nautilus_sampler-0.7.1-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for nautilus_sampler-0.7.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 19516b128b98cf20add1fd6b0aae437e1519bade7a4e13c32842022fd58a641c
MD5 8e324bc6382a5adcd364fb16c172020e
BLAKE2b-256 be2af5565368a6691f754ce50c5e0a15bf547d2345775742305c175fcdb14499

See more details on using hashes here.

Supported by

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