Hello,
I'm a graduate student at the university of minnesota and I'm working with Brad
Carlin on my masters project. We've run into a bit of a problem and he
suggested I email this list. We're trying to fit the following model:
X[1] ~ normal(0, 1)
and for i in 2:20
X[i] ~ normal(rho*X[i-1], 1)
Then
S[i] = 1 if X[1] > 0 and S[1] = -1 if X[1] < 0 for all i
Obviously we are interested in the posterior distribution of rho. The only data
entered in WinBUGS are the S[i]'s. So a vector of 1 and -1's. This seemed easy
enough, we used the following model in WinBUGS:
model
{
x[1] ~ dnorm(0,tau)
s[1] <- step(x[1])*2 - 1
for( i in 2:20){
mu[i] <- x[i-1]*rho
x[i] ~ dnorm(mu[i], tau)
s[i] <- step(x[i])*2 - 1
}
rho ~ dunif(-.95,.95)
tau ~ dunif(.0001,100)
}
WinBUGS says the model is syntactically correct and the data loads fine but
when we compile it says, "multiple definitions of node s[2]." We worked on it
for a couple of hours and didn't get anywhere. I was just wondering if anyone
had worked with a model similar to this or if anyone has any ideas. Thanks a
lot. Have a good day.
joe koopmeiners
-------------------------------------------------
This mail sent through IMP: http://horde.org/imp/
-------------------------------------------------------------------
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
|