Note
This packages is no longer maintained. I cannot guarantee you can still get it running, nor help you with it.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- Metropolis-Hastings (MH), with an independent candidate density. Either
a normal, a student-
t or a user-provided candidate density can be used. - (Griddy) Gibbs (GG), where the user can but does not have to provide the conditional densities of the model. When the densities are not provided, numerical inversion of the empirical distribution function is used for sampling from this conditional density.
- Importance sampling (IS), with a candidate density as with MH.
- Adaptive Polar sampling, a method where MH is used for sampling a direction, with the distance added through numerical inversion of the true conditional density of the distance given the direction. See e.g. the article on Adaptive Radial-based Direction Sampling (Bauwens, Bos, Van Dijk and Van Oest, in Journal of Econometrics, 2004).
- Adaptive Polar Importance Sampling, a method like APS but with the MH step replaced by an importance step. See the aforementioned article.
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 packagesmc2pack.zip | MC2Pack itself |
gnudraw6.zip | GnuDraw |
oxutils.zip | OxUtils |
To install the documentation on your computer, add the following lines
<tr><td><a href="../packages/gnudraw/doc/gnudraw7.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.
This packages is no longer maintained. I cannot guarantee you can still get it running, nor help you with it.