The runjags package


The runjags package for R provides high-level interface utilities for MCMC models via Just Another Gibbs Sampler (JAGS), facilitating the use of parallel (or distributed) processors for multiple chains, automated control of convergence and sample length diagnostics, and evaluation of the performance of a model using drop-k validation or against simulated data. Template model specifications can be generated using a standard lme4-style formula interface to assist users less familiar with the BUGS syntax. A JAGS extension module provides additional distributions including the Pareto family of distributions, the DuMouchel prior and the half-Cauchy prior. The runjags package is hosted on CRAN as well as this sourceforge page, and has an accompanying publication at the Journal of Statistical Software.

The intention of this package is to provide an easy access route towards MCMC models for users with little experience with this type of modelling. Common convergence checks, summary statistics and useful plots are automatically calculated and made available via user-friendly access functions via print(), summary() and plot() methods.

Occasional news regarding the runjags package will be announced through the notifications page - if you would like to be kept up to date about CRAN releases, intermediate sourceforge releases and other information please subscribe to this feed. A list of publically available JAGS extension modules is available from here.


A quick-start vignette is included within the runjags package, and can also be accessed from here. This is a good way to quickly get to grips with the features provided. A more detailed manuscript outlining the usage of this code can be downloaded from here.


There are three different packages available to download from this site:

runjags: this includes the JAGS module, and therefore requires JAGS and C++ compilers to install.

runjags_nomodule: this version of runjags without the JAGS module does not include any C++ code and has no reliance on JAGS for installation, and should therefore be installable on any system using R CMD INSTALL.

ParetoPrior: this standalone version of the JAGS module within runjags can be fully installed on your system, making it available to separate JAGS processes as well as rjags processes. It requires JAGS and C++ compilers (but not necessarily R) to install. Binaries of this module for some platforms are also available.

All three versions require the installation of JAGS.


If you find a bug or have a question regarding something within the runjags package (for example if a function does not work as expected, you get a strange error message, or if you think the help files could use some specific improvements) then either email the package maintainer (via the contact details on the CRAN page) or post a message on the runjags forum.

More general questions relating to the JAGS models themselves are likely to get a faster and more useful response from the JAGS forum.

If you are interested in learning more about MCMC, JAGS and the runjags package then have a look at the residential course on applied Bayesian methods for ecology and epidemiology being run on the beautiful shores of Loch Lomond near Glasgow. More information on this course is available from this page, or to view all related courses being run at this location see this website. The preparatory homework for course participants can be found here.


Please remember to cite the runjags package (as well as R and JAGS) if you use this software as part of a peer-reviewed publication. The preferred format for referencing is as follows:

Matthew J. Denwood (2016). runjags: An R Package Providing Interface Utilities, Model Templates, Parallel Computing Methods and Additional Distributions for MCMC Models in JAGS. Journal of Statistical Software, 71(9), 1-25. doi:10.18637/jss.v071.i09


The source code contained in src/distributions/jags/ (and elements elsewhere where indicated) is Copyright (C) 2002-10 Martyn Plummer, licensed under GPL-2. All other code is Copyright (C) Matthew Denwood, licensed under GPL-2. A copy of the GPL-2 license should be included with each download.

Download runjags

Valid XHTML + RDFa

Valid CSS!