Hi,
I have some problems when I fit logit model in OpenBugs. The model is syntactically correct. Data can be loaded and the model can be compiled and initialized. However, it stopped running after I hit update. I emailed the helpdesk yesterday, and they told me that I need to supply initial values. Now I have questions about how to define the initial values. Do I need to supply initial values for both beta and mu? If only beta needs initial values, it should be list(beta[j]=0), or list(beta[1]=0, beta[2]=0,...,beta[7]=0)? I tried both of them, but it didn't work. Following is my code for logit model.
#MODEL for Logistic Regression
model
{
#likelihood
for (i in 1:1042) # loop over observations
{
y[i] ~ dbern(prob[i]) #prob of survived (latent variable)
logit(prob[i])<-beta[1] +beta[2]*x1[i]+beta[3]*x2[i]+beta[4]*x3[i]+beta[5]*x4[i]+beta[6]*x5[i]+beta[7]*x6[i] # logistics regression model
}
#prior distributions
for (j in 1:7)
{
beta[j]~dnorm(mu[j],0.1) # prior for beta
mu[j]~dnorm(0,0.1) # prior for mu
}
}
#INITS
list(beta[j]=0, mu[j]=0)
Thank you!
Ping Zhou
-------------------------------------------------------------------
This list is for BUGS users to support each other, ask questions or share ideas.
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
|