Skip to main content

Data from: Efficient Bayesian analysis of occupancy models with logit link functions

Cite this dataset

Clark, Allan E.; Altwegg, Res (2019). Data from: Efficient Bayesian analysis of occupancy models with logit link functions [Dataset]. Dryad.


Occupancy models (Ecology, 2002; 83: 2248) were developed to infer the probability that a species under investigation occupies a site. Bayesian analysis of these models can be undertaken using statistical packages such as WinBUGS, OpenBUGS, JAGS, and more recently Stan, however, since these packages were not developed specifically to fit occupancy models, one often experiences long run times when undertaking an analysis. Bayesian spatial single‐season occupancy models can also be fit using the R package stocc. The approach assumes that the detection and occupancy regression effects are modeled using probit link functions. The use of the logistic link function, however, is algebraically more tractable and allows one to easily interpret the coefficient effects of an estimated model by using odds ratios, which is not easily done for a probit link function for models that do not include spatial random effects. We develop a Gibbs sampler to obtain posterior samples from the posterior distribution of the parameters of various occupancy models (nonspatial and spatial) when logit link functions are used to model the regression effects of the detection and occupancy processes. We apply our methods to data extracted from the 2nd Southern African Bird Atlas Project to produce a species distribution map of the Cape weaver (Ploceus capensis) and helmeted guineafowl (Numida meleagris) for South Africa. We found that the Gibbs sampling algorithm developed produces posterior samples that are identical to those obtained when using JAGS and Stan and that in certain cases the posterior chains mix much faster than those obtained when using JAGS, stocc, and Stan. Our algorithms are implemented in the R package, Rcppocc. The software is freely available and stored on GitHub (

Usage notes