I am having problems with the adaption in JAGS. If adapt if very small (~100) the model then runs without problems. If the adapt is larger the model crashes at some point in the adaption phase with the message:
Error in node ......
Invalid parent values
Deleting model
The only thing I can think of it that I have parameters that are enforced to be positive. Perhaps these are causing the adaption to fail?
The model is given below:
model{
for(i in 1:m){
y[i] ~ dnorm(log(mu[i])+ang[i]bias,tau)
part1[i] <- 1-exp(-theta[ind[i],3]del[i])
part2[i] <- 1-exp(-theta[ind[i],3]del2[ind[i]])
mu[i] <- theta[ind[i],1] + theta[ind[i],2]part1[i]/part2[i]
}
for(i in 1:n){
theta[i,1] ~ dlnorm(mualpha[1],taualpha[1])
theta[i,2] ~ dlnorm(mualpha[2],taualpha[2])
theta[i,3] <- exp(mualpha[3])
}
tau <- 1/(sdy^2)
sdy ~ dunif(0,10)
for(h in 1:3){
taualpha[h] <- 1/(sdalpha[h]^2)
sdalpha[h] ~ dunif(0,10)
mualpha[h] ~ dnorm(0,0.0001)
}
bias ~ dnorm(0,0.0001)
}
where y, ang, del, del2, ind, m and n are all data.
Anonymous
Apologies. This bug appears to not be the relevant problem. I transferred the problem to WinBUGS and while monitoring during the adaptive phase found the problem. As I wrote on the features thread -- I would be great if you made it possible to monitor during adaption so that it was possible to diagnose problems such as this (and monitor convergence!).