ARSpy

ARSpy


Keywords
adaptive, adaptive-rejection-sampling, ars, python, rejection-sampling, sampling, statistics
License
MIT
Install
pip install ARSpy==0.4

Documentation

ARSPY

Build Status Docs Coverage Pypi_

This package provides a pure python/numpy implementation of adaptive rejection sampling as proposed by P. Wild, W.R. Gilks in Algorithm AS 287: Adaptive Rejection Sampling from Log Concave Density functions.

Under the (frequently satisfied) assumption that the target distribution to sample from has a log-concave density function, this algorithm allows us to sample without calculating any integrals.

This sampling method is exact (all resulting samples are i.i.d) and efficient and our implementation can handle any univariate log-concave distribution.

One prime use case is Gibbs sampling, where one frequently encounters many 1D log-concave distributions.

Install

Simply run:

pip3 install ARSpy

Documentation

Our documentation can be found at http://arspy.readthedocs.io/en/latest/.