The problem involves trying to characterize the probability:
P.f = Pd*Pr{t1 < t2}
using jags or WinBUGS. The issue is the last term where both t1 and t2 are random variables. A sample, stripped down, model using this is given below and hopefully provides insight into what I am trying to do. As expected, I get an error indicating that I am redefining the variable 'y'. Searching for a trick to get past this is proving difficult.
Any insight would be appreciated!
FWIW, I've also posted a similar question on the WinBUGS list, but cross-posted here with the hope of reaching a wider audience.
model {
for(j in 1:N) {
t.1[j] ~ dweib(alpha.1,lambda.1)
t.2[j] ~ dweib(alpha.2, lambda.2);
p.det[j] ~ dbeta(a,b);
y[j] <- step(t.2[j]-t.1[j]);
y[j] ~ dbern(py);
}
alpha.1 ~ dgamma(0.3,0.0001);
lambda.1 ~ dnorm(0., 10000.);
alpha.2 ~ dgamma(0.3,0.0001);
lambda.2 ~ dnorm(0., 10000.);
py ~ dbeta(0.3,0.3);
a ~ dgamma(1, 0.01)
b ~ dgamma(1, 0.01)
pd ~ dbeta(a,b)
p.f<- pd*py
}