PK Á|X suppl-1.htmUT NfNf
James C. Russell, Martin Stjernman, Åke Lindström, Henrik G. Smith. 2015. Community occupancy before-after-control-impact (CO-BACI) analysis of Hurricane Gudrun on Swedish forest birds. Ecological Applications 25:685–694. http://dx.doi.org/10.1890/14-0645.1
Supplement
Model code and data structure for fitting CO-BACI using OpenBUGS.
Ecological Archives A025-038-S1.
Authors
File list (downloads)
Description
James C. Russell
School of Biological Sciences and Department of Statistics
University of Auckland
Private Bag 92019
Auckland, New Zealand
E-mail: j.russell@auckland.ac.nz
Martin Stjernman
Department of Biology
Lund University, S-223 62
Lund, Sweden
E-mail: martin.stjernman@biol.lu.se
Åke Lindström
Department of Biology
Lund University, S-223 62
Lund, Sweden
E-mail: ake.lindstrom@biol.lu.se
Henrik G. Smith
Department of Biology
Lund University, S-223 62
Lund, Sweden
E-mail: henrik.smith@biol.lu.se
File list
CO-BACI_OpenBUGS_code.txt (MD5: e552deab013414b9fc910186bdcef87b)
Description
The CO-BACI OpenBUGS code.txt gives the model code and data structure for fitting using OpenBUGS.
ESA Publications | Ecological Archives | Permissions | Citation | Contacts
PKq PK Á|X CO-BACI_OpenBUGS_code.txtUT NfNf# Community Occupancy Before After Control Impact (CO-BACI) OpenBUGS code # Data consist of i = nspecies, j = nsites, k = nsurveys, m = ntimes for an impact[j] measured at j sites # with h additional site covariates covar-h[j] at j sites and x[m,i,k,j] species detection observations model { # ===< Priors >=== # priors for detectability and occupancy and their random effects p0 ~ dunif(0,1) psi0 ~ dunif(0,1) for (y in 1:2) { # 1=detectability, 2=occupancy sigma[y] ~ dunif(0,10) tau[y] <- (1/(sigma[y]*sigma[y])) } # priors for correlation between detectability and occupancy rho ~ dunif(-1,1) mup <- log(p0/(1-p0)) mupsi <- log(psi0/(1-psi0)) var.eta <- tau[1]/(1.-pow(rho,2)) # priors for fixed effects # fix first time period as baseline for (y in 1:2) { # 1=detectability, 2=occupancy alpha[y,1]<-0 gamma[y,1]<-0 for (m in 2:ntimes) { alpha[y,m] ~ dunif(-10,10) gamma[y,m] ~ dunif(-10,10) } beta[y] ~ dunif(-10,10) # h additional site covariates (here h=1) for (i in 1:nspecies) { delta1[y,i] ~ dunif(-10,10) # and so on for additional delta } } # ===< Likelihood >=== # Process model for (i in 1:nspecies) { # some definitions lpsi[i] ~ dnorm(mupsi,tau[2]) mu.lp[i] <- mup +(rho*sigma[1]/sigma[2])*(lpsi[i]-mupsi) lp[i] ~ dnorm(mu.lp[i],var.eta) for (j in 1:nsites) { for (m in 1:ntimes) { logit(psi[j,i,m]) <- lpsi[i]+alpha[2,m]+delta1[2,i]*covar1[j]+ beta[2]*impact[j]+gamma[2,m]*impact[j] z[j,i,m] ~ dbern(psi[j,i,m]) } } } # Observation model for (i in 1:nspecies) { for (j in 1:nsites) { for (k in 1:nsurveys) { for (m in 1:ntimes) { logit(mu[j,k,i,m]) <-lp[i]+alpha[1,m]+delta1[1,i]*covar1[j]+ beta[1]*impact[j]+gamma[1,m]*impact[j] mu2[j,k,i,m] <- z[j,i,m]*mu[j,k,i,m] x[m,i,k,j] ~ dbern(mu2[j,k,i,m]) # note rotation from R to BUGS data } } } } # Derived estimates for (i in 1:nspecies) { for (m in 1:ntimes) { psi.spp[i,m]<-sum(z[,i,m])/nsites p.spp[i,m]<-sum(mu[,1,i,m])/nsites # note we sum over the first entry because there are no survey effects } } } PK<ܘ PK- Á|Xq @ suppl-1.htmUT NfPK- Á|X<ܘ @Z CO-BACI_OpenBUGS_code.txtUT NfPK F