In preparation for the course please install the following, preferably in the below suggested order.

Remember you will need to bring your own personal computer for the duration of the course.

Step 1

Install the following using the corresponding links

Step 2

Now install the following packages by going into Rstudio (or R) and typing:

install.packages(c('R2jags', 'rdatamarket'))

Step 3

Check that everything works by going to a command line terminal and typing jags. If it opens successfully type exit.

Now go into R and copy and paste the following text:

library(R2jags)
model_code="
model {
  y ~ dnorm(mu,1)
  mu ~ dnorm(0,1)
}
"
model=jags(data=list(y=1),
           model.file=textConnection(model_code),
           parameters.to.save = 'mu',
           n.chains=1)
plot(model)

This should produce a plot.

Troubleshooting

If you run into any problems please drop us a line at andrew.parnell@ucd.ie or dougmcneall@gmail.com.