JAGS error for MCMC Bayesian inference

#1
In R, I am running an MCMC Bayesian inference for data from mixture of Gamma distributions. JAGS is used here. The model file gmd.bug is as follows
Code:
model {
for (i in 1:N) {
y[i] ~ dsum(p*one, (1-p)*two)
}
one ~ dgamma(alpha1, beta1)
two ~ dgamma(alpha2, beta2)
alpha1 ~ dunif(0, 10)
beta1 ~ dunif(0, 10)
alpha2 ~ dunif(0, 10)
beta2 ~ dunif(0, 10)
p ~ dunif(0, 1)
}
Then, this is the inference phase
Code:
gmd.jags = jags.model("gmd.bug",
data = list(N = NROW(a), y=unlist(a)),
inits = inits, n.chains = 3, n.adapt = 1000)
Here is the error that puzzled me
Code:
Error in jags.model("gmd.bug", data = list(N = NROW(a), y = unlist(a)),  : 
Error in node y[1]
Node inconsistent with parents
Anyone know what needs to be fixed here?
 
Last edited: