Print

Print


Just reading your code rapidly, it seems that the variable q is defined two times as
q <- (1/(1+teta)) and q~dbeta(a,b)


Arnaud

2016-09-21 22:50 GMT-04:00 Amir Jamali <[log in to unmask]>:
Hi Everyone,

I am trying to implement the NB-Lindley for crash analysis. However, I get the error which says "Multiple definitions for node". Could you please guide me how to tackle this error?


Problem:

O=NB(phi,e*mubar)
e~Gamma(1+z, teta)
z~Bernoulli(1/(1+teta))
Beta prior for (1/ (1+teta)) and a gamma prior for (1/phi).




The model has been coded as below:
model Negative Binomial Lindley

{

for (i in 1:N)
{
O[i] ~ dnegbin(phi,mu[i])
mubar[i] <- exp(beta1*log(X1[i])+beta0 +  beta2*X2[i] +beta3*X3[i] + beta4*X4[i]
              + beta5*X5[i] +beta6*X6[i])
e[i] ~ dgamma(r,teta)
mu[i] <- e[i]*mubar[i]

}

# Priors for parameters
beta0 ~ dnorm(0,1.0E-06)
beta1 ~ dnorm(0,1.0E-06)
beta2 ~ dnorm(0,1.0E-06)
beta3 ~ dnorm(0,1.0E-06)
beat4 ~ dnorm(0,1.0E-06)
beta5 ~ dnorm(0,1.0E-06)
beta6 ~ dnorm(0,1.0E-06)
z~ dbern(q)
q <- (1/(1+teta))
r <- (1+z)
q~dbeta(a,b)
l~dgamma(c,d)
l<- (1/phi)
a~dnorm(0.1,1.0)
b~dnorm(0.1,1.0)
c~dnorm(0.1,1.0)
d~dnorm(0.1,1.0)

}


Thanks in advance.
-------------------------------
Amir Jamali
Graduate Research Assistant
Montana State University
Email: [log in to unmask]

-------------------------------------------------------------------
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

------------------------------------------------------------------- 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