Neural Network-Boosted Importance Sampling for Bayesian Statistics
Project description
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 often 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 accepted 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file nautilus_sampler-0.7.4.tar.gz
.
File metadata
- Download URL: nautilus_sampler-0.7.4.tar.gz
- Upload date:
- Size: 37.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.31.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2b79b7145617930ca77c0b6d5cbe0aeac40bac56bfe921f3647c062dcf7a94b7 |
|
MD5 | 0f14c1008f0b6cf28a05beb8a81cba95 |
|
BLAKE2b-256 | 38f3d44c28abf00631fe6cf1278c5dd36b5b2e8fcd0bd0bf2c3f7cffe5e95950 |
File details
Details for the file nautilus_sampler-0.7.4-py2.py3-none-any.whl
.
File metadata
- Download URL: nautilus_sampler-0.7.4-py2.py3-none-any.whl
- Upload date:
- Size: 31.1 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.31.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4e5ff629e4560dad24f8f3a9bea9aaf6546bd2bc6ef5e9dd3459ed0fbb7c513d |
|
MD5 | 342df0bee7dc5eac8ddbc98d574c214c |
|
BLAKE2b-256 | e21d4ba426dd161665160dda668a30d6ba7d062424f9220acf5b10a90d16e0e3 |