Outline content for the workshop

Bayesian analysis with JAGS and R


King Mongkut's University of Technology Thonburi (KMUTT), 3 to 14 July 2017

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 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.

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:

  • Writing JAGS code for -
    • ordinary (Gaussian) regression models
    • logistic regression model
  • 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.

We will extend this to include hierarchical or random-effects models:

  • The concept of random effects.
  • Including random effects in JAGS models.
  • Random intercepts and random slopes.
  • Visualizing the output from hierarchical models.

Then we will tackle examples of wildlife-related problems, where models must account for probability of detection. We will focus first on occupancy modelling:

  • Simple occupancy models; joint estimation of occupancy and detection.
  • Occupancy models in JAGS; starting values.
  • Simulating occupancy data.
  • Occupancy models with covariates for occupancy and/or detection.
  • Species distribution maps from occupancy models.
  • Multi-year and two species models.
  • Extending these concepts to N-mixture models.

Abundance estimation from spatially-explicit capture-recapture (SECR) data is a major area of application for Bayesian analysis:

  • Data augmentation for population estimation.
  • Concepts behind SECR.
  • SECR analysis with unrestricted state spaces.
  • Extracting and mapping activity centres.
  • Adapting the analysis for irregular study areas.
  • Incorporating covariates.
  • Estimating population trends from SECR data.
  • Extending this to individual survival.

Finally we will look at multi-species or community occupancy models (MSOMs):

  • The concepts behind MSOMs; data requirements and formatting.
  • Occupancy models with species as random effects.
  • Species-specific effects; habitat and detection covariates.
  • Species richness with data augmentation.
  • Site similarity (beta diversity) and species similarity.
  • Regional maps and summaries.
  • Extending these ideas to dynamic community models and muti-species abundance models.

All participants should come with a laptop computer with recent versions of R and JAGS installed.

Participants will be asked to complete an R Skills Review as a prerequisite for the workshop.

Back to BCSS Home Page


Page updated 23 Feb 2017 by Mike Meredith