Intro to WinBUGS / JAGS
Fri 27 January 2012 by Adrian BrasoveanuPlan for the Jan. 31 & Feb. 2 classes; feel free to bring your laptops to class and work through the scripts on your own as we go through them in class:
-
First script: bayes-winbugs-jags-1.r; contents:
- the mean model: simulated data, R analysis, WinBUGS / JAGS analysis
- the structure of WinBUGS / JAGS models, reexpressing parameters, number of chains, number of iterations, burnin, thinning, the Brooks-Gelman-Rubin (BGR) convergence diagnostic (a.k.a. Rhat), graphical summaries of posterior distributions
- binomial proportion inference with WinBUGS / JAGS instead of the Metropolis algorithm we built “by hand” for this purpose
- comparison of 3 models for the same binomial proportion data with different uniform priors: posterior estimation with WinBUGS / JAGS and computing the evidence / marginal likelihood for each model based on the WinBUGS / JAGS posterior samples
- inference for 2 binomial proportions with WinBUGS / JAGS instead of the Metropolis algorithm we built “by hand” for this purpose
-
Second script: bayes-winbugs-jags-2.r; contents:
- essentials of linear models (focus on design matrices)
- t-tests with equal and unequal variances: simulated data, R analysis, WinBUGS / JAGS analysis