I am currently working on my thesis and interested in estimating a Weibull conditional Hazard Frailty Model for recurrent event data using WinBUGS. I wrote the model but when am trying to use it with the following script it hangs unexpectedly. It returns a messages titled "undefined real result". What am I doing wrong? Also, I have tried different prior and initial values but I could not solve the problem!
model
{
for(i in 1:633){
ht[i]<-gama*pow((t[i]),(gama-1))*exp(age[i]*b[1]+sex[i]*b[2]+mar[i]*b[3]+back1[i]*b[4]+back2[i]*b[5]+form[i]*b[6]+u[subject[i]]+delta*enu[i])
}
for(i in 1:633){
beta[i]<-pow((1/gama),((gama*pow((t[i]),(gama-1)))/ht[i]))
}
for(i in 1:633){
t[i]~dweib(gama,beta[i]) I(cen[i],)
}
for (j in 1:6){
b[j]~dnorm(0,0.001)
}
for(i in 1:159){
u[i]~dnorm(0,tau)
}
delta~dnorm(0,0.01)
gama~dgamma(1,0.01)
tau~dunif(0,100)
sigma2.subject<-1/tau
}
list(b=c(0,0,0,0,0,0),gama=1,tau=1,delta=0)
I would appreciate it if you could help me for solving this problem.