dummy-link

AffineInvariantMCMC

Goodman & Weare's Affine Invariant Markov chain Monte Carlo (MCMC) Ensemble sampler

Readme

AffineInvariantMCMC

AffineInvariantMCMC performs Bayesian sampling using Goodman & Weare's Affine Invariant Markov chain Monte Carlo (MCMC) Ensemble sampler. AffineInvariantMCMC is a module of MADS. Goodman & Weare's algorithm implementation in Python is called Emcee.

AffineInvariantMCMC AffineInvariantMCMC AffineInvariantMCMC Build Status Coverage Status

Reference:

Goodman, Jonathan, and Jonathan Weare. "Ensemble samplers with affine invariance." Communications in applied mathematics and computational science 5.1 (2010): 65-80. Link

Installation

import Pkg; Pkg.add("AffineInvariantMCMC")

Example

import AffineInvariantMCMC

numdims = 5
numwalkers = 100
thinning = 10
numsamples_perwalker = 1000
burnin = 100

const stds = exp(5 * randn(numdims))
const means = 1 + 5 * rand(numdims)
llhood = x->begin
    retval = 0.
    for i in 1:length(x)
        retval -= .5 * ((x[i] - means[i]) / stds[i]) ^ 2
    end
    return retval
end
x0 = rand(numdims, numwalkers) * 10 - 5
chain, llhoodvals = AffineInvariantMCMC.sample(llhood, numwalkers, x0, burnin, 1)
chain, llhoodvals = AffineInvariantMCMC.sample(llhood, numwalkers, chain[:, :, end], numsamples_perwalker, thinning)
flatchain, flatllhoodvals = AffineInvariantMCMC.flattenmcmcarray(chain, llhoodvals)

Documentation

All the available MADS modules and functions are described at madsjulia.github.io

AffineInvariantMCMC functions are documented at https://madsjulia.github.io/Mads.jl/Modules/AffineInvariantMCMC

Projects using AffineInvariantMCMC

Publications, Presentations, Projects

First Commit

10/04/2016

Last Touched

about 1 month ago

Commits

42 commits

Used By: