Outline content for the workshop

Bayesian analysis with JAGS and R


During our Boot Camp in wildlife study design and data analysis, we introduce the concepts underlying Bayesian approaches to data analysis, and we run standard analyses with the wiqid package in R. The next step is to learn to code your own models.

The modelling language used by the JAGS package makes it easy to write code for quite complex models, as the code closely follows the mathematical expressions we use to define the model. JAGS does not have a stand-alone GUI, but is closely integrated with R statistical software.

Basic R skills are needed for this workshop, and we ask applicants to complete an R Skills Review before confirming places.

The workshop will focus on techniques used for terrestrial vertebrates; they can usually be modified for use with invertebrates or plants, or for aquatic systems, but our examples will be for terrestrial systems.

Outline of content

We'll begin with a review of probability and Bayes Rule, applying this to simple examples with just one or two parameters to estimate. This will be familiar to you if you have recently attended a Boot Camp, but we'll use different examples.

Next we'll look at modern computer-intensive methods for analysis of models with more than one parameter to estimate:

  • JAGS code basics.
  • Running JAGS from R via the jagsUI package.
  • Understanding what JAGS does: how MCMC (Markov Chain Monte Carlo) methods work.
  • Initial values, burn-in, and convergence; checking for convergence.
  • Error messages and debugging.
  • Using the output from JAGS.

Once everyone is familiar with the mechanics of running analyses in JAGS, we will tackle examples of wildlife-related problems with emphasis on model building:

  • Simple occupancy models with detection probability less than 1.
  • Extensions of occupancy models including covariates; species distribution maps.
  • Multi-year occupancy models: site colonisation and local extinction.
  • Data augmentation for population estimation modelling.
  • Estimating density from spatially-explicit capture recapture data (SCR/SECR).
  • Open SCR models and multi-year data: survival and recruitment.
  • Multi-species occupancy models (MSOMs): biological communities and species richness assessment and mapping..

Working through these examples will lead to discussion of detailed issues:

  • Prior specification and appropriate non-informative priors.
  • Supplying appropriate initial values.
  • Calculating derived variables within JAGS.
  • Checking model fit.
  • Model selection and multimodel inference.

All participants should come with a laptop computer with recent versions of R and JAGS installed. They will be asked to complete an R Skills Review before the workshop.

Back to BCSS Home Page


Page updated 10 Jan 2020 by Mike Meredith