Tools for Bayesian inference using Ensemble MCMC
Project description
Collection of tools for Bayesian inference using DIME MCMC
This provides the Differential-Independence Mixture Ensemble (DIME) proposal together with a nice set of statistical tools for Bayesian analysis. DIME MCMC (previously ADEMC) is developed in Ensemble MCMC Sampling for DSGE Models. (Gregor Boehl, 2022, CRC 224 discussion paper series).
The sampler has a series of advantages over conventional samplers:
At core, DIME MCMC is a (very fast) global multi-start optimizer that converges to the posterior distribution. This makes any posterior mode density maximization prior to MCMC sampling superfluous.
The DIME sampler is pretty robust for odd shaped, bimodal distributions.
DIME MCMC is parallelizable: many chains can run in parallel, and the necessary number of draws decreases almost one-to-one with the number of chains.
DIME proposals are generated from an endogenous and adaptive proposal distribution, thereby reducing the number of necessary meta-parameters and providing close-to-optimal proposal distributions.
Installation
Installing the repository version from PyPi is as simple as:
pip install emcwrap
There exists a complementary stand-alone implementation in Julia language.
Usage
The proposal can be used directly as a drop-in replacement for emcee:
import emcee
from emcwrap import DIMEMove
move = DIMEMove(aimh_prob=.1, df_proposal_dist=10)
...
# define your density function, number of chains etc...
...
sampler = emcee.EnsembleSampler(nchain, ndim, log_prob, moves=move)
...
# off you go sampling
The rest of the usage is hence analoge to Emcee, see e.g. this tutorial. The parameters specific to the ADEMove are documented here.
The provided tools for Bayesian analysis are ready-to-use, but largely undocumented. Find the module documentation here: https://emcwrap.readthedocs.io/en/latest/modules.html
References
@techreport{boehl2022mcmc,
title = {Ensemble MCMC Sampling for DSGE Models},
author = {Boehl, Gregor},
year = 2022,
institution = {CRC224 discussion paper series}
}
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.