model {
NAA[1:3] ~ dmulti(XAA[1:3], KAA)
NAB[1:3] ~ dmulti(XAB[1:3], KAB)
NBB[1:3] ~ dmulti(XBB[1:3], KBB)
XAA[1] <- (1 - sigma)*p + sigma XAA[2] <- (1 - sigma)*q XAA[3] <- 0 XAB[1] <- (1 - sigma)*p/2 + sigma/4 XAB[2] <- 0.5 XAB[3] <- (1 - sigma)*q/2 + sigma/4 XBB[1] <- 0 XBB[2] <- (1 - sigma)*p XBB[3] <- (1 - sigma)*q + sigma KAA <- sum(NAA[]) KAB <- sum(NAB[]) KBB <- sum(NBB[]) p ~ dunif(0, 1) sigma ~ dunif(0, 1) q <- 1 - p } Data:
list(NAA = c(427, 95, 0), NAB = c(108, 161, 71), NBB = c(0, 64, 74))

Inits:
list(p = 0.5, sigma = 0.5)

Node statistics
node mean sd MC error 2.5% median 97.5% start sample
p 0.7049 0.02394 2.455E-4 0.6562 0.7053 0.7497 1001 10000
q 0.2951 0.02394 2.455E-4 0.2504 0.2947 0.3438 1001 10000
sigma 0.37 0.04158 4.236E-4 0.287 0.3703 0.4509 1001 10000

Posterior densities