I am coding a Triavariate Poisson in Openbugs. Here is a picture of the distribution: http://i.stack.imgur.com/HS4u7.png When I compile it, it says that "logical expression contains too many constant". Can anyone help me where did I go wrong? Here is my code: model{ for(i in 1:n){ dummy[i] <- 0 dummy[i] ~ dloglik(logLike[i]) # This is the log transformation of the 3-variate poisson logLike[i] <- -theta12[i] + (k[1] + step(s1[i]-.9)*k[2] + step(s1[i]*.5-.9)*k[3])*log(theta12[i]) - logfact(k[1] + step(s1[i]-.9)*k[2] + step(s1[i]*.5-.9)*k[3]) -theta13[i] - (r[1] + step(s2[i]-.9)*r[2] + step(s2[i]*.5-.9)*r[3])*log(theta13[i]) - logfact(r[1] + step(s2[i]-.9)*r[2] + step(s2[i]*.5-.9)*r[3])-theta23[i] - (s[1] + step(s3[i]-.9)*s[2] + step(s3[i]*.5-.9)*s[3])*log(theta23[i]) - logfact(s[1] + step(s3[i]-.9)*s[2] + step(s3[i]*.5-.9)*s[3])-theta1[i] + (y1[i]-(k[1] + step(s1[i]-.9)*k[2] + step(s1[i]*.5-.9)*k[3])-(r[1] + step(s2[i]-.9)*r[2] + step(s2[i]*.5-.9)*r[3]))*log(theta1[i]) + logfact(y1[i]-(k[1] + step(s1[i]-.9)*k[2] + step(s1[i]*.5-.9)*k[3])-(r[1] + step(s2[i]-.9)*r[2] + step(s2[i]*.5-.9)*r[3]))-theta2[i] + (y2[i]-(k[1] + step(s1[i]-.9)*k[2] + step(s1[i]*.5-.9)*k[3])-(s[1] + step(s3[i]-.9)*s[2] + step(s3[i]*.5-.9)*s[3]))*log(theta2[i]) + logfact(y2[i]-(k[1] + step(s1[i]-.9)*k[2] + step(s1[i]*.5-.9)*k[3])-(s[1] + step(s3[i]-.9)*s[2] + step(s3[i]*.5-.9)*s[3]))-theta3[i] + (y3[i]-(r[1] + step(s2[i]-.9)*r[2] + step(s2[i]*.5-.9)*r[3])-(s[1] + step(s3[i]-.9)*s[2] + step(s3[i]*.5-.9)*s[3]))*log(theta3[i]) + logfact(y3[i]-(r[1] + step(s2[i]-.9)*r[2] + step(s2[i]*.5-.9)*r[3])-(s[1] + step(s3[i]-.9)*s[2] + step(s3[i]*.5-.9)*s[3])) log(theta1[i]) <- alpha1 + beta1*log(L[i]) log(theta2[i]) <- alpha2 + beta2*log(L[i]) log(theta3[i]) <- alpha3 + beta3*log(L[i]) log(theta12[i]) <- alpha4 + beta4*log(L[i]) log(theta23[i]) <- alpha5 + beta5*log(L[i]) log(theta13[i]) <- alpha6 + beta6*log(L[i]) } alpha1 ~ dgamma(.001, .001) alpha2 ~ dgamma(.001, .001) alpha3 ~ dgamma(.001, .001) alpha4 ~ dgamma(.001, .001) alpha5 ~ dgamma(.001, .001) alpha6 ~ dgamma(.001, .001) beta1 ~ dgamma(.001, .001) beta2 ~ dgamma(.001, .001) beta3 ~ dgamma(.001, .001) beta4 ~ dgamma(.001, .001) beta5 ~ dgamma(.001, .001) beta6 ~ dgamma(.001, .001) } data list(y1 =c(0,1,2,3,2), y2 = c(1,2,3,0,2), y3 = c(1,3,2,3,2), k = c(0,1,2,3,4), s = c(0,1,2,3,4), r = c(0,1,2,3,4), L = c(1,2,3,4,5), s1= c(0,1,2,0,2), s2= c(0,0,0,0,0), s3= c(1,1,0,0,0),n=5) inits list(beta1=0,beta2=0,beta3=0,beta4=0,beta5=0,beta6=0,alpha1=0,alpha2=0,alpha3=0, alpha4=0,alpha5=0,alpha6=0) ------------------------------------------------------------------- This list is for discussion of modelling issues and the BUGS software. For help with crashes and error messages, first mail [log in to unmask] To mail the BUGS list, mail to [log in to unmask] Before mailing, please check the archive at www.jiscmail.ac.uk/lists/bugs.html Please do not mail attachments to the list. To leave the BUGS list, send LEAVE BUGS to [log in to unmask] If this fails, mail [log in to unmask], NOT the whole list