Developed by Martyn Plummer, JAGS was created to provide a cross-platform, open-source alternative to WinBUGS while maintaining compatibility with the BUGS modeling language. Since its release, JAGS has become one of the most widely used tools for Bayesian analysis in the applied sciences, valued for its reliability, flexibility, and compatibility with R through the rjags and R2jags packages.
Development History
Martyn Plummer releases the first version of JAGS, providing a cross-platform, open-source alternative to WinBUGS that runs on Linux, macOS, and Windows.
JAGS gains widespread adoption in ecology, epidemiology, and the social sciences, supported by integration with R and a growing library of example models.
JAGS continues to be actively maintained and remains a popular choice for applied Bayesian modeling, especially in fields with established BUGS-language workflows.
Technical Design
JAGS uses a modular architecture that separates the modeling language parser, the model graph compiler, and the sampling algorithms. This design allows new sampling modules to be added without modifying the core software. JAGS supports a range of MCMC algorithms, including conjugate Gibbs sampling, slice sampling, and Metropolis-Hastings steps for non-conjugate models. The software automatically selects appropriate samplers for each node in the model graph.
JAGS implements a dialect of the BUGS language that is largely compatible with WinBUGS and OpenBUGS, making it straightforward to migrate existing models. However, JAGS also extends the language in several ways, supporting a wider range of distributions and link functions, and providing improved error handling and diagnostics.
Integration with R
One of JAGS's greatest strengths is its seamless integration with R. The rjags package provides a low-level interface for running JAGS models from R, while R2jags and jagsUI offer higher-level wrappers that simplify common workflows. These R packages allow researchers to prepare data, run models, and analyze results entirely within the R environment, leveraging R's powerful plotting and data manipulation capabilities. The coda package provides MCMC diagnostics that work directly with JAGS output.
Applications and User Community
JAGS is particularly popular in ecology and conservation biology, where hierarchical models for species abundance, occupancy, and survival are standard tools. Books such as Bayesian Population Analysis Using WinBUGS (Kéry and Schaub) and Applied Hierarchical Modeling in Ecology (Kéry and Royle) have introduced generations of ecologists to Bayesian modeling using JAGS. The software is also widely used in epidemiology, psychology, and education research.
"JAGS brought BUGS to every platform and made it open source. For many applied researchers, it remains the most direct path to Bayesian modeling."— Martyn Plummer
Relationship to Other Software
While Stan and PyMC have introduced more advanced sampling algorithms (particularly Hamiltonian Monte Carlo), JAGS continues to fill an important niche. Its support for discrete parameters—which Stan does not directly handle—makes it the tool of choice for models involving latent discrete variables, such as mixture models and hidden Markov models. For many researchers, JAGS remains the most accessible entry point to Bayesian computation.