'I came into this Error: object 'lambda' not found in R2jags
Hi I came into this error but I already defined lambda. I really don't know where it went wrong. Does anybody know how to solve this? Here is my code
binomial.model.JAGS = function(){
y ~ dbin(p,n)
p<-lambda*mu+rho*(1-mu)
lambda ~ dunif(min = 0.2,max = 1.4)
mu ~ dunif(min = 0,max = 1)
rho ~ dunif(min = 0.1,max = 1.7)
}
n = 100000
y = 30000
data.JAGS = list(y = y,n = n)
inits.JAGS = list(list(lambda = 0.8,mu = 0.5, rho = 0.9))
para.JAGS = c('p', 'lambda', 'mu', 'rho')
fit.JAGS = jags(data = data.JAGS, inits = inits.JAGS,
parameters.to.save = para.JAGS,
n.chains = 1,
n.iter = 9000,
n.burnin = 1000,
model.file = binomial.model.JAGS())
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
