%
% 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 );

cd('C:\Brani\MyBugs\matbugs\')
[samples, stats] = matbugs(dataStruct, ...
		fullfile(pwd, 'milan.txt'), ...
		'init', init0, ...
        'nChains', 1, ...
		'view', 0, ...
        'nburnin', 1000, ...
        'nsamples', 10000, ...
		'thin', 1, ...
		'monitorParams', {'theta'}, ...
        'Bugdir', 'C:/Program Files/BUGS');

baymean = mean(samples.theta)
frmean=mean(dataStruct.scores)

  figure(1)
  [p, x] = ksdensity(samples.theta);
  plot(x, p);
