Git Product home page Git Product logo

mcpar's Introduction

MCPar: A Parallel Markov Chain Monte Carlo Driver

Introduction

MCPar is a parallel implementation of the Metropolis-Hastings Monte Carlo algorithm (Metropolis, et al. 1953, Hastings 1970). The algorithm samples the distribution using multiple concurrent Markov chains, correcting for the quasi-ergodicity problem, using a variant of the algorithm proposed by Murray (2010). (That paper also explains the quasi-ergodicity problem, for readers unfamiliar with it.) The code is able to parallelize over multiple processors using MPI and within a single processor using vectorization.

The code is designed so that users can plug in their own likelihood functions. Likelihood functions are implemented by writing subclasses of the VLFunc interface class. The version of the code in this repository has a couple of simple examples using sums of Gaussians and Rosenbrock functions (Rosenbrock, 1960). There is also a wrapper for a likelihood function written in R, if that is the sort of thing you are into.

Requirements

The code is set up to link to a set of MPI libraries. It has been tested with both OpenMPI and Intel MPI. It also uses the Intel Math Kernel Library (MKL). You will need to have both of these libraries in order to build and run the code.

If you want to write your likelihood function in R, you will also need to have R installed, along with the Rcpp and RInside packages. This functionality is optional and is not built by default. If you want to use it, set and export the environment variable USE_RFUNC before you build.

References

Hastings, W. K. (1970), "Monte Carlo Sampling Methods Using Markov Chains and Their Applications", Biometrika 57: 97--109

Metropolis, N., et al. (1953), "Equations of state calculations by fast computing machines", J. Chem. Phys. 21: 1087--92.

Murray, L. (2010), "Distributed Markov Chain Monte Carlo", Proceedings of Neural Information Processing Systems workshop on learning on cores, clusters, and clouds 11.

Rosenbrock, H. H. (1960), "An automatic method for finding the greatest or least value of a function", The Computer Journal 3: 175--184.

mcpar's People

Contributors

rplzzz avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

hwang127

mcpar's Issues

There should be some warmup with remote proposals

Right now the warmup phase generates only local proposals. Only once the main iteration phase begins (and samples are being recorded) do we start to generate remote proposals from other chains. The problem with this approach is that for large parallel runs we invariably end up with a few Markov chains that are way off the mark when the recording starts. This has the effect of polluting the output with very long tails (i.e., low probability mass, but very wide range of parameter values) of junk samples.

We could fix this by allowing part of the warmup to generate remote proposals. We don't necessarily want to have remote proposals from the start because that would tend to collapse all of the Markov chains to the single chain that has the best starting location, but phasing them in toward the end of the warmup, after the chains have had a chance to find the best values in the neighborhood of their starting position, could be a big win.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.