model { |
p0[1] ~ dbeta(1,1) |
p0[2] ~ dbeta(1,1) |
sigma ~ dgamma(1,1) |
beta0 ~ dnorm(0, 0.1) |
beta1 ~ dunif(−100,0) |
w ~ dbern(0.5) |
for(g in 1:nPixels) { |
mu[g] <- exp(beta0 + beta1*bait.dist[g]*w)*pixelArea |
pi[g] <- mu[g]/sum(mu)} |
EN <- sum(mu) |
psi <- EN animals-11-02334M |
for(i in 1:M) { |
z[i] ~ dbern(psi) |
s[i] ~ dcat(pi[]) |
for(j in 1:J) { |
p[i,j] <- p0[bait[j]]*exp(-1*pow(d[s[i],j],2)/(2*sigma^2)) |
for(k in 1:K) { |
y[i,j,k] ~ dbern(p[i,j]*z[i]*oper[j,k])}}} |
N <- sum(z) |
} |