Re: Help with BUGS model



On 22 aug, 15:16, vontres...@xxxxxx wrote:
This seems to work as an extension of your code:

model
{
for (i in 1:K)
{
Signal[i] <- mu[i]/E[i]
N[i]~ dpois( mu[i] )
mu[i]<- lambda[i]*E[i]
lambda[i] <-P*lambda1[i]+(1-P)*lambda2[i] #result of equation 4.
lambda1[i] ~ dgamma( a1, b1 )
lambda2[i] ~ dgamma( a2, b2 )

}

a1 ~dunif(0.000001, 100)
b1 ~ dunif(0.000001, 100 )
a2 ~dunif(0.001, 100)
b2 ~ dunif(0.001, 100 )
P~dbeta(10,100)}

}


Dear Mark, I tested the model with a simulated dataset (simulate N and
E) it works. However the parameters of the mixture of gamma
distributions do not converge well (the samplesHistory shows a bad
interation pattern for the P and the as and bs.
With the model where the Lambdas are drawn from only one gamma prior I
have very good iteration pattern on the other hand. What do you think
is the explanation for that?

.