Golden cats and BUGS
   stats main page

Lab guide (pdf, 54KB)
Data file (zip, 364KB)

Objectives

In this unit we will use the OpenBUGS software package to model present/absence data, extracting the detection probability parameter and getting the occupancy rate for various habitat types.

BUGS (Bayes Using Gibbs Sampler) uses Bayesian methods to produce a posterior distribution for the parameters of the model we want to evaluate. If you are not familiar with Bayesian analysis - in particular the idea of probability as 'degree of belief' and the concepts of prior and posterior probability - you should look at the "Bayes in Brief" page before tackling this exercise.

You should also be familiar with the concepts of occupancy and detection probability and with the golden cats data set: you should work through the analysis of these data in PRESENCE before beginning the BUGS analysis.


Working through the analysis

This exercise uses camera trap data on golden cats at 9 sites in Peninsular Malaysia collected during a tiger survey between December 1997 and October 1999 (Lynam et al 2007), the same data set analysed in PRESENCE elsewhere on this site.

Download the file "Golden_cats_BUGS.zip" and extract the files inside to a folder on your hard disk.

Download the lab guide "Golden_cats_BUGS.pdf". You will probably want to print out the lab guide and have it next to your computer while you work through the instructions.

Work through the lab guide before checking the results below.


Results

The BUGS analysis gave similar results to the analysis in PRESENCE, which is reassuring!

There was no evidence of a difference in detection probability between the two habitat types - the coefficient was extremely small.

Looking at the model without the habitat covariable for detection, psi(habitat) p(.), we are 75% sure that occupancy is higher in Logged forest, but the effect is probably small: we are 50% sure that the odds ratio is between 1 and 1.9. The median estimates for occupancy are 0.32 for Primary habitat and 0.39 for Logged habitat; the 50% credible intervals overlap.

The output from PRESENCE don't allow us to make probability statements about the effect of habitat on occupancy in the same way. However, we can compare the sums of the AIC weights of the models with and without the habitat effects:

psi(.) p(.) 0.4975 psi(habitat) p(.) 0.2258
psi(.) p(habitat) 0.1924 psi(habitat) p(habitat) 0.0843
sum = 0.6899 sum = 0.3101

This indicates that the probability of psi(.) models is double that of psi(habitat) models.

The model with no covariates, psi(.) p(.), gave a median estimate of psi = 0.36 with 95% credible interval of [0.24, 0.53]. The median estimate of probability of detection is 0.14, 95% CrI [0.09, 0.19]. For comparison, the psi(.), p(.) model in PRESENCE gave psi = 0.35 with 95% CI [0.23, 0.48] and p = 0.14 with 95% CI [0.09, 0.20].


Comparison of Bayesian and Maximum Likelihood methods

The main difference between Bayesian and non-Bayesian methods, such as the Maximum Likelihood algorithms used by PRESENCE, is that Bayesian results (ie. posterior distributions) depend on prior information as well as the data. In this case, however, we used very ‘flat’ priors, so the posterior distributions are virtually the same as the likelihood curves.

In this situation, the main sources of difference are:

  • PRESENCE uses maximum likelihood estimation, ie. it looks at the peak (mode) of the curve, not the mean or the median, which are reported in BUGS. These are only the same if the curve is symmetrical.
     
  • PRESENCE estimates the variance (and s.d.) of the curve from the shape of the peak. Inferences based on the shape of the tails – including confidence intervals and p-values – involve assuming a specific shape for the curve, usually a normal or t-distribution. BUGS, on the other hand, explicitly explores the whole posterior distribution.

There are also of course conceptual differences due to the interpretation of probability as 'degree of belief', so that, for example, we are 95% sure that the right answer lies within the Bayesian 95% credible interval, and we can state that the probability that we are 75% sure that Logged habitat has a higher occupancy than Primary habitat.


What next?

Chapter 4 of MacKenzie et al (2006) has a brief description of a BUGS model without covariates which is applied to a data set blue ridge two-lined salamanders.

Royle & Dorazio (2008) cover occupancy estimation thoroughly, using both maximum likelihood estimation and Bayesian analyses in WinBUGS. (They also cover a range of other topics, including mark-recapture, survival analysis, distance sampling and community composition.)

The OpenBUGS and WinBUGS packages include tutorials with many examples, which you want to look at, but are not directly relevant to occupancy estimation.

wcsmalaysia.org home

Page updated 24 Nov 2008 by Mike Meredith