Using Classic BUGS and WinBUGS with Matlab

Two helper functions and some examples of using Classic BUGS and WinBUGS with Matlab.

Helper functions

Last updated 2003-08-19

mat2bugs.m
Save Matlab variables in S-PLUS format for BUGS
bugs2mat.m
Read BUGS CODA output to Matlab structure
These were originally written by Jouko Lampinen and modified by Aki Vehtari.

Thanks for Leming Qu sending a fix for mat2bugs.m and Windows Matlab. mat2bugs.m used fprintf('%G',val) which worked just fine, but for some reason Windows Matlab prints 3 digits in exponent while WinBUGS 1.4 requires that there is only 2 digits...

Examples


Aki Vehtari
Last modified: 2003-08-20