我正在尝试运行以下模型。它有几个logit链接,它们是循环的。
model {
for(i in 1:8){
year.eff[i] ~ dnorm(0,tau.yr)
annual.controlrenest[i] <- pow(ilogit(beta0+year.eff[i]+beta.renest),37)
annual.treatmentrenest[i] <-
pow(ilogit(beta0+year.eff[i]+beta.treatment+beta.renest),37)
annual.controlnest[i] <- pow(ilogit(beta0+year.eff[i]),37)
annual.treatmentnest[i] <- pow(ilogit(beta0+year.eff[i]+beta.treatment),37)
annual.controlrenest[i] <- pow(ilogit(beta0+year.eff[i]+beta.renest),37)
annual.treatmentrenest[i] <-
pow(ilogit(beta0+year.eff[i]+beta.treatment+beta.renest),37)
}
# Likelihood
for(i in 1:539){
for(j in (enter.nest[i]+1):left.nest[i]){
logit(phinest[i,j]) <- beta0 + year.eff*year.nest[i] +
beta.treatment*Treatment[i] + beta.renest*Renest[i]
mu[i,j] <- phinest[i,j] * n[i,j-1]
n[i,j] ~ dbern(mu[i,j])
}
}
}
但是,我收到以下错误,似乎无法找出问题所在。我的logit链接没有循环之前我已经得到了这个错误(你无法在JAGS中对一个logit链接进行矢量化)。
Error in checkForRemoteErrors(lapply(cl, recvResult)) :
3 nodes produced errors; first error: RUNTIME ERROR:
Invalid vector argument to ilogit