Dear Bugs user,
I am trying to put a point mass mixture prior on change point. when I
try to run the model it says" value of bernoulli p[1] must be integer".
I will really appreciate if anybody can share any code or give me some
feedback. I am not sure where i am doing wrong. Is there any way to
model point mass mixture prior in a different way:
The structure for point mass is : K is point mass with probability p and
truncated normal with probability (1-p). p follows bernoulli.
Here is the code:
#K[i] is the change point. We have change point in fixed effect and
random effect
model{
for (i in 1:N) {
for (j in 1:M) {
Y[i, j] ~ dnorm(muy[i, j], tauz)
muy[i,
j]<-beta1[1]+beta1[2]*step(t[j]-K[i])+beta1[3]*step(K[i]-t[j]-1)+beta1[4]*x1[i]+beta1[5]*x2[i]+beta1[6]*x3[i]+U[i,1]+U[i,2]*step(t[j]-K[i])
+U[i,3]*step(K[i]-t[j]-1)
}
U[i,1:3] ~ dmnorm(U0[],tau[,]) ;
#prior for change point
K[i]<-p[i]*0+(1-p[i])*C # mixture of point mass and truncated normal
distribution
p[i]~dbern(0.5)
}
C~dnorm(a,b)I(0,)
}
If I replace the truncated normal with Uniform (0,T) distribution, the
same problem arises.
thanks a lot.
With Best,
Pulak ghosh
Department of Mathematics and Statistics
Georgia state University
Atlanta
-------------------------------------------------------------------
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
|