% % Milan from Matlab+WinBUGS % clear init0 dataStruct = struct( ... 'N', 5, ... 'tau',1/80,... 'xi',1/120,... 'mu',110,... 'scores',[97 110 117 102 98]); init0 = struct( ... 'theta', 100 ); [samples, stats] = matbugs(dataStruct, ... fullfile(pwd, 'milan.txt'), ... 'init', init0, ... 'nChains', 1, ... 'view', 0, ... 'nburnin', 1000, ... 'nsamples', 1000, ... 'thin', 1, ... 'monitorParams', {'theta'}, ... 'Bugdir', 'C:/Program Files/BUGS'); stats.mean [p, x] = ksdensity(samples.theta(c,:)); plot(x, p, colors(c));