MC2Pack

While working on diverse projects, I found myself rewriting simulation code over and over again. After a while, I started collecting chunks, which came to be MC2Pack, an Ox package for using MCMC sampling methods to construct a sample from a posterior density.

An earlier version of this package bore the name MCMCPack, though it was developped entirely independently from the work by Andrew Martin and Kevin Quinn on MCMCpack on R. To avoid confusion, the name of the Ox package was changed from MCMCPack to MC2Pack.

Implemented sampling methods

Implemented in the package are

Apart from sampling, the package can also provide estimates of the (logarithm of) the marginal likelihood of the model, a building block for the Bayes factor which contrasts models according to their fit to the data.

Documentation

The documentation of the package is available on the web, and also in PDF format in the article Markov Chain Monte Carlo methods: Implementation and comparison. This latter article is also included within the installation file.

As an example, the file mcstack.ox samples from a mixture model on stackloss data.

Download and installation instructions

Download the packages
mc2pack.zip MC2Pack itself
gnudraw5.zip GnuDraw
oxutils.zip OxUtils
and unzip them from your Ox main directory. MC2Pack depends on some files in the other packages, hence the larger installation procedure. If you want to use GnuDraw fully, also to view the graphs on screen instead of using GiveWin, finish off the installation by getting a working version of GnuPlot; see also the installation instructions at the GnuDraw page.

To install the documentation on your computer, add the following lines

<tr><td><a href="../packages/gnudraw/doc/gnudraw.html">Gnudraw Graphics</a></td></tr>
<tr><td><a href="../packages/oxutils/doc/oxutils.html">OxUtils</a></td></tr>
<tr><td><a href="../packages/mc2pack/doc/mc2pack.html">MC2Pack</a></td></tr>
to the file <ox-home>/doc/oxmenu.html, e.g. after the line pointing to the graphics reference.

The present version 2.05 works for me, though probably contains some bugs. Please let me know if you find any.

MC2Pack change log

Below a list of the changes in MC2Pack. The latest version is available as mc2pack.zip.

09/7/2009
Updated this page to refer to version 5 of GnuDraw.
05/11/2007
Updated the example files to work with the latest version of OxUtils.
04/01/2005
Included a check to see if opening the output file succeeded, thanks to Gao Feng.

[Main page] [Top] [Next: MC2Pack reference]
Last change: 9/7/2009