follow-up:
when assigning a stochastic node
library(nimble)
code <- nimbleCode({
for(i in 1:N) {
for(j in 1:M) {
for(k in 1:Index_if[i,j]) {
y[i,j] ~ dbeta(1,1)
}
}
}
})
Index_if <- matrix(c(1,1,0,0,0, 0,0,0,0,1), nrow=5)
constants <- list(N=5, M=2, Index_if=Index_if)
Rmodel <- nimbleModel(code, constants)
the following warning message is generated:
Warning message:
In genExpandedNodeAndParentNames3(debug = debug) :
Multiple definitions for the same node. Did you forget indexing with 'k' on the left-hand side of 'y[i, j] ~ dbeta(shape1 = 1, shape2 = 1, lower_ = 0, upper_ = 1, .mean = 0.5, .sd = 0.28867513459481287)'?model compiles and running MCMC seems to work too
just reporting this here in case other people run into this message.