model {
r <- 1; n <- 2; a[1] <- 1; a[2] <- 5; a[3] <- 20
for (i in 1:3) {
a.inv[i] <- 1/a[i]
theta[i] <- pow(psi[i], a.inv[i])
psi[i] ~ dbeta(a.inv[i], 1)
}
r1 <- r; r2 <- r; r3 <- r # replicate data
r1 ~ dbin(theta[1], n)
r2 ~ dbin(theta[2], n)
r3 ~ dbin(theta[3], n)
}
Inits:
list(psi=c(0.5,0.2,0.05))
Dbar = post.mean of -2logL; Dhat = -2LogL at post.mean of stochastic nodes
Dbar Dhat pD DIC
r1 1.945 1.386 0.559 2.505
r2 1.945 1.550 0.395 2.341
r3 1.933 2.289 -0.356 1.577
total 5.824 5.225 0.599 6.422
node mean sd MC error 2.5% median 97.5% start sample
psi[1] 0.5005 0.2234 3.174E-4 0.09535 0.5005 0.9056 1001 500000
psi[2] 0.1075 0.1642 5.941E-4 7.481E-6 0.03163 0.6081 1001 500000
psi[3] 0.01192 0.05659 3.621E-4 1.122E-20 1.187E-6 0.1385 1001 500000
theta[1] 0.5005 0.2234 3.174E-4 0.09535 0.5005 0.9056 1001 500000
theta[2] 0.5009 0.2235 0.001167 0.09436 0.5012 0.9053 1001 500000
theta[3] 0.5046 0.2213 0.004354 0.1006 0.5055 0.9059 1001 500000