I hope this is an easy question.
I can fit a normal mixture model just fine using the Eyes example:
model eyes;
const N=48;
var y[N],T[N], lambda[2], theta, tau, sigma, P[2], alpha[2];
data y in "mixture.dat";
inits in "mixture.in";
{
for(i in 1:N){
y[i] ~ dnorm(lambda[T[i]], tau);
T[i] ~ dcat(P[]);
}
sigma <- 1/sqrt(tau);
tau ~ dgamma(0.01, 0.01);
lambda[1] ~ dnorm(0,1.0E-6);
lambda[2] <- lambda[1]+theta;
theta ~ dnorm(0,1.0E-6) I(0,);
P[] ~ ddirch(alpha[]);
alpha[1] <- 1;
alpha[2] <- 1;
}
But when I attempt to use a mixture for my own Poisson data, I get the
error:
Error in file: mixturePoisson.bugs
for node: lambda[1]
-- error --
Unable to choose update method for node
Can anyone offer suggestions?
model PIL10C;
const N=47;
var y[N],T[N], lambda[2], theta, sigma, P[2], alpha[2];
data y in "mixtureP.dat";
inits in "mixtureP.in";
{
for(i in 1:N){
y[i] ~ dpois(lambda[T[i]]);
T[i] ~ dcat(P[]);
}
lambda[1] ~ dgamma(0.001, 0.001);
theta ~ dnorm(0, 0.001) I(0,);
lambda[2] <- lambda[1] + theta;
P[] ~ ddirch(alpha[]);
alpha[1] <- 1;
alpha[2] <- 1;
}
Thank you.
Jason
-------------------------------------------------------------------
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
|