#### The integral presented in Eq. 1, describing detection probability for a distance category k, #### has no closed form for point surveys. In our simulation study, we therefore used the mid-point of each #### distance category to calculate the detection probability for that category: # [... code ommitted ...] for (j in 1:nsites){ log(sigma[j])<-alphaS+betaS1*chap[j] #detection parameter for(k in 1:nG){ ## here nG is 3, corresponding to 100-m bands as were used in the original analysis of field data log(p[k,j])<- -xg[k]*xg[k]/(2*sigma[j]*sigma[j]) f[k,j]<- p[k,j]*pi[k] fc[k,j]<- f[k,j]/pcap[j] } pcap[j]<-sum(f[1:nG,j]) # overall detection probability # [... code ommitted ...] ################################################################################################################################ #### The approach above is a rather coarse approximation. When computation time is not limiting, a better approximation #### can be reached using narrower distance bands and summing these up to obtain more accurate etimates of detection probability #### in a coarse distance ban # [... code ommitted ...] for (j in 1:nsites){ log(sigma[j])<-alphaS+betaS1*chap[j] #detection parameter for(k in 1:nG){ ## here, nG is 30, corresponding to 10-m bands log(p[k,j])<- -xg[k]*xg[k]/(2*sigma[j]*sigma[j]) f[k,j]<- p[k,j]*pi[k] } ### sum over 10 bands to get detection probability for each 100m interval fc.s[1,j]<-sum(f[1:10,j])/pcap[j] fc.s[2,j]<-sum(f[11:20,j])/pcap[j] fc.s[3,j]<-sum(f[21:30,j])/pcap[j] pcap[j]<-sum(f[1:nG,j]) # overall detection probability # [... code ommitted ...] #### A small simulation study on single-year distance sampling data showed that bias in most parameter estimates from the coarse #### approximation is low and similar to the better approximation with narrower bands. Even in those parameters where bias is higher #### in the coarse approximation, confidence interval coverage is the same for both approximations. ################################################################################################################################ #### For transects surveys the integral (S) in Eq.1 becomes #### p_k = S f(x) dx ---------, w #### where f(x) = exp(-(x^2)/2 sigma^2) and w = width of the distance band #### This integral can be expressed in closed form and implemented in JAGs as shown below: # [... code ommitted ...] for (j in 1:nsites){ log(sigma[j])<-alphaS+betaS1*chap[j] #detection parameter f.0[j] <- 2 * dnorm(0,0, 1/sigma[j]^2) for(k in 1:nG){ up[j,k]<-pnorm(db[k+1], 0, 1/sigma[j]^2) low[j,k]<-pnorm(db[k], 0, 1/sigma[j]^2) p[j,k]<- 2 * ( up[j,k] - low[j,k] f[j,k]<- p[j,k]/f.0[j]/w ## detection prob. in distance category k fc[j,k]<- f[j,k] * pi[k] ## pi=percent area of k; drops out if constant fct[j,k]<-fc[j,k]/sum(fc[j,1:nG]) } pcap[j]<-sum(fc[j,1:nG]) # [... code ommitted ...]