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 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')
Documentation
You can find the documentation at nautilus-sampler.readthedocs.io.
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.5.0.tar.gz
.
File metadata
- Download URL: nautilus-sampler-0.5.0.tar.gz
- Upload date:
- Size: 32.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.28.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e7f163822de8f52060088eb8c099783dedc387169273d00e6178866253361935 |
|
MD5 | ddbe391145196ebfaa5c5f66017be1ab |
|
BLAKE2b-256 | 57e3182a1c3c4f7e94cedbdcbf89690cae4e7cc3d193f73862f03ca2563bf064 |
File details
Details for the file nautilus_sampler-0.5.0-py2.py3-none-any.whl
.
File metadata
- Download URL: nautilus_sampler-0.5.0-py2.py3-none-any.whl
- Upload date:
- Size: 27.6 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.28.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 81496c0de5cb106a3f35369efc8fbe2845087c0b92e118407073923802641207 |
|
MD5 | 830c751d44a365dd8696a373aa718a12 |
|
BLAKE2b-256 | b79e895dcda5d59f85c39a9bd42e7ac56ecc72011c4ea071686cc5a8160a4d37 |