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:
[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!)
error in ==> matbugs at 259 dos(str); % DOS wants a\bit is because winbugs created an error message and then you pressed ctrl-c in matlab. Use matbugs(..., 'view', 1) to see the winbugs error message.