## S-114.600 Introduction to Bayesian Modeling | |

Set up a

- pooled
- separate
- and a hierarchical model

Because the BUGS software is not too easy to use, the hierarchical model is given. You only have to modify it to produce the pooled and separate models. And run the simulations for the hierarchical model, of course.

You will need the following files:

- bugs.dat: data
- bugsa.in: initial values for the pooled model
- bugsb.in: initial values for the separate model
- bugsc.in: initial values for the hierarchical model
- bugs.m: Matlab example on how to transfer the data to Matlab and convert precision into variance.
- bugs.dat: data
- bugscwin.bug: the hierarchical model for WinBUGS

Open the files with WINBUGS File->Open... and select 'Text' as the file format. Since x has missing values (NA), after 'load inits' you have to click 'gen inits' to generate the initial values for these.

Note that in BUGS the second parameter of the Gaussian distribution (dnorm) is precision, the inverse of the variance, instead of standard deviation. The conjugate prior on precision is the Gamma distribution (dgamma).

Return

- the model specifications for the three models (not the entire bug-file, just the specs)
- the posterior of the quality of the fifth machine with the different models
- the predictive distribution of the fifth machine with the different models
- the posterior of the expected value of the quality of the sixth machine with the different models
- some commentary (a few sentences) on the results

bugs2mat.m

This page is maintained by Toni.Tamminen@hut.fi

This page has been updated 9. 10. 2003

URL: http://www.lce.hut.fi/teaching/S-114.600/ex/bugs_en.html