model{ for(i in 1:N){ k[i]~dbin(theta[i],n) } # Priors for(i in 1:N){ g[i]~dbern(0.5) thetaup[i]~dbeta(1,1)T(0.5,1) theta[i]<-0.5*(g[i]==0)+thetaup[i]*(g[i]==1) } }