Markov Chain Monte Carlo on Constrained Spaces

Marcus A Brubaker, Mathieu Salzmann and Raquel Urtasun

This page hosts the Matlab source code which goes along with the paper A Family of MCMC Methods on Implicitly Defined Manifolds in the proceedings of AISTATS 2012.  Use of this code in any published research should cite this paper.  The code provides an implementation of the Constrained HMC algorithm described in the paper which performs MCMC on distributions subject to non-linear inequality constraints.  Also included is code to reproduce some of the experiments.

Here is the abstract

Traditional MCMC methods are only applicable to distributions defined on $\mathbb{R}^n$. However, there exist many application domains where the distributions cannot easily be defined on a Euclidean space.  To address this limitation, we propose a general constrained version of Hamiltonian Monte Carlo, and give conditions under which the Markov chain is convergent.  Based on this general framework we define a family of MCMC methods which can be applied to sample from distributions on non-linear manifolds.  We demonstrate the effectiveness of our approach on a variety of problems including sampling from the Bingham-von Mises-Fisher distribution, collaborative filtering and  pose estimation.

This code is copyright 2012 Marcus A Brubaker and is distributed freely for academic and personal use only.  Persons interested in commercial use of this code should contact Marcus A Brubaker.  There is no warranty implied or personal liability assumed by any of the authors.  By downloading this code, you accept these terms.

NOTE: There was a typo in the final paper. The equations defining the RATTLE algorithm on page three are slightly wrong. Specifically, the partial derivatives of the Hamiltonian in the definition of q_1 should be with respect to p. This has been fixed in the version available from this website.

Paper: (pdf)
Poster: (pdf)
Source Code: (tar.gz)