I am running a simple beta regression model in JAGS, following the example given here. Here is my JAGS model code as an R object:
jags.model = "
model {
#model
for (i in 1:N){
y[i] ~ dbeta(alpha[i], beta[i])
alpha[i] <- mu[i] * phi
beta[i] <- (1-mu[i]) * phi
logit(mu[i]) <- a + b*x1[i] + c*x2[i] + d*x3[i] + e*x4[i] + f*x5[i]
}
#priors
a ~ dnorm(0, .0001)
b ~ dnorm(0, .0001)
c ~ dnorm(0, .0001)
d ~ dnorm(0, .0001)
e ~ dnorm(0, .0001)
f ~ dnorm(0, .0001)
t0 ~ dnorm(0, 0.010)
phi <- exp(t0)
}"
In the linked example there is a gamma prior on the phi
parameter. However, I kept getting errors, so I shifted to an alternative expoential prior on phi
to keep it positive. Every time I run this code using runjags
I get the error: value out of range in 'gammafn'
, which prints out many many times until I tell the code to stop running. I am unsure what the problem is here, as I am no longer using a gamma function in any of this code. Any insight, or alternative methods to run a beta-regression in JAGS, would be appreciated.