JAGS

Description

From the JAGS Home Page: JAGS is Just Another Gibbs Sampler. It is a program for analysis of Bayesian hierarchical models using Markov Chain Monte Carlo (MCMC) simulation not wholly unlike BUGS. JAGS was written with three aims in mind:

  • To have a cross-platform engine for the BUGS language
  • To be extensible, allowing users to write their own functions, distributions and samplers.
  • To be a plaftorm for experimentation with ideas in Bayesian modelling

Version

  • 3.4.0

Authorized Users

  • CIRCE account holders
  • SC account holders

Platforms

  • CIRCE cluster
  • SC cluster

Modules

JAGS requires the following module file to run:

  • apps/jags/3.4.0

Running JAGS on CIRCE/SC

The JAGS user guide is essential to understanding the application and making the most of it. The guide and this page should help you to get started with your simulations. Please refer to the Documentation section for a link to the guide.

  • Note on CIRCE: Make sure to run your jobs from your $WORK directory!
  • Note: Scripts are provided as examples only. Your SLURM executables, tools, and options may vary from the example below. For help on submitting jobs to the queue, see our SLURM User’s Guide.

Additionally, The rjags package provides an interface from R to the JAGS library. A simple call to library('rjags') will be enough to run JAGS from within R. See R and Rmpi for more information.

Submitting a Job

If, for example, you have a JAGS script file (named "test.cmd for this example), you would set up a submit script like this:

  • The script below (for testing, name it “jags-test.sh”) can be copied into your job directory (the folder with your input files) and modified so that you can submit batch processes to the queue.
#!/bin/bash
#
#SBATCH --comment=jags-test
#SBATCH --ntasks=4
#SBATCH --job-name=jags-test
#SBATCH --output=output.%j.jags-test
#SBATCH --time=01:00:00

#### SLURM 4 processor JAGS test to run for 1 hour.

module purge
module load apps/jags/3.4.0

mpirun jags test.cmd

 
Next, you can change to your job’s directory, and run the sbatch command to submit the job:

[user@login0 ~]$ cd my/jobdir
[user@login0 jobdir]$ sbatch ./jags-test.sh
  • You can view the status of your job with the “squeue -u <username>” command

Documentation

Home Page, User Guides, and Manuals

Benchmarks, Known Tests, Examples, Tutorials, and Other Resources

  • JAGS Examples
    • /apps/jags/3.3.0/example/classic-bugs.tar.gz

More Job Information

See the following for more detailed job submission information:

Reporting Bugs

Report bugs with JAGS to the IT Help Desk: rc-help@usf.edu