Skip to main content

Gaussian Process Approximation to Posterior Distributions

Project description


A Python implementation of [Bayesian Active Learning for Posterior Estimation]( by Kandasamy et al. (2015) and [Adaptive Gaussian process approximation for Bayesian inference with expensive likelihood functions]( by Wang & Li (2017).

[![build status](](

Clone the repository and run

python install

A simple example

from approxposterior import bp, likelihood as lh

# Define algorithm parameters
m0 = 20 # Initial size of training set
m = 10 # Number of new points to find each iteration
nmax = 10 # Maximum number of iterations
M = int(1.0e4) # Number of MCMC steps to estimate approximate posterior
Dmax = 0.1 # KL-Divergence convergence limit
kmax = 5 # Number of iterations for Dmax convergence to kick in
which_kernel = "ExpSquaredKernel" # Which Gaussian Process kernel to use
bounds = ((-5,5), (-5,5)) # Prior bounds
algorithm = "agp" # Use the Wang & Li (2017) formalism

# Initialize object using the Wang & Li (2017) Rosenbrock function example
ap = bp.ApproxPosterior(lnprior=lh.rosenbrock_lnprior,

# Run!, m=m, M=M, nmax=nmax, Dmax=Dmax, kmax=kmax,
bounds=bounds, which_kernel=which_kernel)
Please cite this repository and both Kandasamy et al. (2015) and Wang & Li (2017).

Project details

Release history Release notifications

This version
History Node


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
approxposterior-0.1-py2.py3-none-any.whl (55.5 kB) Copy SHA256 hash SHA256 Wheel py2.py3 Mar 6, 2018
approxposterior-0.1.tar.gz (20.7 kB) Copy SHA256 hash SHA256 Source None Mar 6, 2018

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging CloudAMQP CloudAMQP RabbitMQ AWS AWS Cloud computing Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page