MATBUGS: a matlab interface to WinBUGS

MATBUGS is a Matlab interface for WinBugs and OpenBugs, which are programs for Gibbs sampling applied to hierarchical Bayesian models.

Written by Kevin Murphy and Maryam Mahdaviani, August 2005. Changelog

Download matbugs.zip which contains the main file, matbugs.m (which is the only file you really need),
as well as some demos:

To use openbugs, use
[samples, stats] = matbugs(dataStruct, bugsModelFilename, 'openbugs', 1);

Matbugs automatically generates the script file from the model (e.g., see this example script file), calls WinBUGS, reads in the results (using bugs2mat), and then performs simple convergence diagnostics. Thus it provides complete functionality, very similar to R2WinBUGS (see also this article and Gelman's page).

Note that Matbugs needs write access to the following directory: C:\Program Files\Winbugs14\. This is because Winbugs expects its script file to live there. This means you have to have root privileges to run WinBUGS. (If you know of a workaround to this, please let me know!)

Hints and tips