1. JAGS: Just Another Gibbs Sampler
Martyn Plummer
International Agency for Research on Cancer
Ecological Forecasting Workshop
March 2014
2. Goals/Aims
Portable implementation of BUGS language
Interface to other software:
User interface to R
Back-end interfact to C/C++/Fortran libraries
Extensible
A platform for experimenting with ideas in Bayesian modelling
3. History
Version Release Date
0.1 December 2002
1.0 December 2007
2.0.0 April 2010
3.0.0 August 2011
3.4.0 September 2013
JAGS became feasible when the
R Math functions became
available as a standalone library.
JAGS has been in a
consolidation phase, with no
changes to the library API since
August 2011
4. Technical Implementation
Very much like OpenBUGS:
User writes a description of the model in the BUGS language
An interpreter creates a virtual graphical model (VGM)
Sampler factories inspect the VGM looking for design motifs
to sample.
User runs MCMC updates, monitoring mixing and convergence
But also not like OpenBUGS:
No GUI.
No output processing: use R or another package.
Core library with dynamically loadable modules that provide
functions, distributions, samplers and monitors.
5. Strengths
Portable (Windows, Mac OS X, Linux)
Several R interfaces (rjags, R2jags, runjags)
Widely used (> 10000 downloads of 3.3.0 - but I don’t know
who these people are)
6. Limitations
For the user:
High memory overhead (inherent to VGM design)
Lack of support for Gaussian Markov Random Fields
For the developer:
Lack of developer documentation
No critical mass
7. Applications
In my own field (epidemiology), there are standard models for
most study designs
But sources of “complexity” perturb the model outside the
range of these standard models:
Repeated measurements, hierarchical structure, missing data,
measurement error, ...
We use JAGS to build models that can be adapted to cope
with complexity.
8. Current and future development
Disclaimer: there is no timeline on any of this
HMC for GLMMs
Parallelism
Compiler overhaul:
if/else statements
vectorized indexing
local variables in loops
Potentials (Likelihoods that do not correspond to a
distribution)
Better treatment of censored survival data