# This JAGS model was created using 'makeJAGStree' in the 'JAGStree' package in R. # The root may have lognormal or discretized uniform prior. # Branching and leaf prior distributions are assumed Dirichlet and Multinomial, respectively. data { pZ.params <- c(pZ1, pZ2); pA.params <- c(pA1, pA2); } model { Z.cont ~ dlnorm(mu, tau); Z <- round(Z.cont); pZ ~ dbeta(pZ.params[1], pZ.params[2]); AB[1] ~ dbinom(pZ, Z); AB[2] <- Z - AB[1]; pA ~ dbeta(pA.params[1], pA.params[2]); CD[1] ~ dbinom(pA, AB[1]); CD[2] <- AB[1] - CD[1]; }