Lecture notes in PDF — hard copies will be handed out at Warwick.
R demonstration scripts for
simulated annealing
MCMC simulation of the Strauss process,
including an introduction to CODA
slice sampling.
For animations, note the comments in the files: you will need to turn anti-aliasing off, and set the graphics device up for the fastest possible response.
R script for Tuesday's computer lab
CIS1.R
R script for Wednesday's computer lab
CIS2.R
R script for Thursday's computer lab
CIS3.R
All JAGS model files can be found in directory scripts.
Some of the parallel code may throw up a message from the firewall on Windows or Macs. You may not be able to grant the permissions it is asking about (they may need administrator privileges), but they are not actually needed (the firewall code fails to notice that it is connections to the same machine that are being used).
If you have the opportunity to use 64-bit R we suggest you do: the scripts may run appreciably faster.
Some of the code makes use of multiple cores on the computer for speed, and we will assume that you have at least two (the Warwick labs do). It is also possible to have multiple R sessions open and run computer-intensive tasks on one or more in the background.
JAGS comes in a combined version for 32- and 64-bit Windows. Download and install JAGS-3.3.0.exe.
Then install packages LearnBayes, MCMCpack and rjags from CRAN in the usual way (which will pull in coda).
(Note that JAGS is a unsigned package, so users of Mountain Lion will need to Control/right-click the .pkg, select 'Open with' then Installer and 'Open'. This currently says 3.3.0 supports Lion and Mountain Lion, but 3.1.0 is available for Snow Leopard.)
This should work with 32-bit or 64-bit R: R >= 3.0.0 is 64-bit only.
There are Debian and Ubuntu packages for JAGS available: some of them are too old although 3.1.0 (as available for Ubuntu 12.04) should be OK. You might want to try
sudo apt-get install libblas-dev liblapack-dev jagsThere are also packages such as r-cran-mcmcpack, but these are often not current (and MCMCpack 1.3.3 is needed, not 1.2.3).
JAGS binaries for various RPM-based distributions have been available here.
Packaging of the JAGS sources for Gentoo is available as an `ebuild' for x86 and amd64.
If you install JAGS from the sources on x86_64 Linux do read the installation manual: on RedHat/Fedora/SuSE systems you need to set libdir since the default is the (out-of-step-with-the-world as usual) Debian convention.