model{
for (i in 1:n.wi) {
pi.kin[i] <- ilogit(beta)
P[i, 1] <- (1 - pi.kin[i])
P[i, 2] <- pi.kin[i]
kin[i] ~ dcat(P[i, 1:2])
}
for (i in 1:n.bw) {
bw.log.dist[i] ~ dnorm(alpha[1], prec[1])  T(l.lim, 
u.lim)
}
for (i in 1:n.wi) {
wi.log.dist[i] ~ dnorm(alpha[kin[i]], prec[kin[i]])  
T(l.lim, u.lim)
}
for (k in 1:2) {
prec[k] <- pow(sigma2[k], -1)
sigma2[k] <- pow(sigma[k], 2)
}
sigma[1] ~ dnorm(1, prec.se1)
sigma[2] ~ dnorm(1, prec.se2)
prec.se1 ~ dgamma(0.5, 0.5)
prec.se2 ~ dgamma(0.5, 0.5)
alpha[1] ~ dunif(non_kin_low, non_kin_high)
alpha[2] ~ dunif(kin_low, kin_high)
beta ~ dunif(-5, 0.00000E+00)
}
