# Try out different order-restrictions model { k ~ dbin(theta,10) theta ~ dbeta(1,1) # method Lee & Wagenmakers book, which does not work: # theta1 ~ dunif(0,1) # theta2 ~ dunif(0,theta1) # same problem, not mentioned in "The BUGS Book": # theta1 ~ dbeta(1,1) # theta2 ~ dbeta(1,1)I(,theta1) # same problem, joint is not flat: # theta1 ~ dunif(0,1) # p ~ dunif(0,1) # theta2 <- p*theta1 # encompassing approach, joint is flat; selection takes place in R: # theta1 ~ dunif(0,1) # theta2 ~ dunif(0,1) # constraints using ones trick, joint is flat: # theta1 ~ dunif(0,1) # theta2 ~ dunif(0,1) # z <- 1 # z ~ dbern(constraint) # constraint <- step(theta1-theta2) # constraints using "sort", joint is flat thetap[1] ~ dunif(0,1) thetap[2] ~ dunif(0,1) thetaprior[1:2] <- sort(thetap[]) theta2 <- thetaprior[1] theta1 <- thetaprior[2] }