Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mcleonard/sampyl
MCMC samplers for Bayesian estimation in Python, including Metropolis-Hastings, NUTS, and Slice
https://github.com/mcleonard/sampyl
Last synced: 3 months ago
JSON representation
MCMC samplers for Bayesian estimation in Python, including Metropolis-Hastings, NUTS, and Slice
- Host: GitHub
- URL: https://github.com/mcleonard/sampyl
- Owner: mcleonard
- License: mit
- Created: 2015-06-26T22:35:16.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2022-12-07T23:24:12.000Z (almost 2 years ago)
- Last Synced: 2024-07-04T02:18:11.022Z (4 months ago)
- Language: Python
- Homepage: http://mcleonard.github.io/sampyl/
- Size: 5.21 MB
- Stars: 324
- Watchers: 33
- Forks: 53
- Open Issues: 24
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Sampyl
May 29, 2018: version 0.3
Sampyl is a package for sampling from probability distributions using MCMC methods. Similar to PyMC3 using theano to compute gradients, Sampyl uses [autograd](https://github.com/HIPS/autograd) to compute gradients. However, you are free to write your own gradient functions, autograd is not necessary. This project was started as a way to use MCMC samplers by defining models purely with Python and numpy.
Sampyl includes these samplers currently:
* Metropolis-Hastings
* Hamiltonian
* NUTS
* SliceFor each sampler, you pass in a function that calculates the log probability of the distribution you wish to sample from. For the Hamiltonian and NUTS samplers, gradient log probability functions are also required. If autograd is installed, the gradients are calculated automatically. Otherwise, the samplers accept gradient log-p functions which can be used whether autograd is installed or not.
It is still under active development with more features coming soon!
### Dependencies
Works for Python 2 or 3.
Currently, [numpy](http://www.numpy.org/) and [scipy](http://www.scipy.org/) are the only dependencies. To use the automatic gradient log-P capabilities, you will need to install [autograd](https://github.com/HIPS/autograd).
### Installation
Unfortunately, there was a name collision, so use this to install from PyPI:
`pip install sampyl-mcmc`
### Documentation
You can find the documentation at http://mcleonard.github.io/sampyl/. It is a work in progress, of course, but we'll cover all the important bits soon enough.
### Tests
Tests are written for use with pytest, in the tests folder.
### License
[MIT](https://github.com/mcleonard/sampyl/blob/master/LICENSE)