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 is based on importance sampling and efficient space
tessellation using neural networks. Its main features are computational
efficiency as well as accuracy of the posterior and evidence estimates.
Example
This simple example, sampling a 3-dimensional Gaussian, illustrates how
nautilus
is used.
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, n_live=500)
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.2.0.tar.gz
.
File metadata
- Download URL: nautilus-sampler-0.2.0.tar.gz
- Upload date:
- Size: 16.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.27.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 52ab73c4d4536ba96b70caaff64c27e3b24e0f131ff921f596410d7e6c604c6f |
|
MD5 | caa827fb7dcb13c3f5e147b4e2eb2afa |
|
BLAKE2b-256 | 338d0311b66c36727c06de2a85e2e5ee07ca4f41e4eae4d6889727fec3dfc705 |
File details
Details for the file nautilus_sampler-0.2.0-py2.py3-none-any.whl
.
File metadata
- Download URL: nautilus_sampler-0.2.0-py2.py3-none-any.whl
- Upload date:
- Size: 17.9 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.27.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 61de9af47efcbe27a3b533039fa7abd24b03ae794224526a3772c03dfa0aaf03 |
|
MD5 | a989abc83abc2bc13a9b5f5559df7b66 |
|
BLAKE2b-256 | 104454d5b42d9cf9352b21a9d51620a7601027873c9af53ea1f6126050fb80a4 |