Hello everyone,
I am pretty new to Bayesian Inference so apologies in case this is a misunderstanding of the concepts. I am essentially trying to sample a variable “y” based on a Zero One Inflated Beta Regression model. Now, since this is zero one inflated beta regression, there are 3 distributions essentially that we need to look out for. I have modeled it as follows,
y_zero = pm.Uniform("y_zero", 0, epsilon)
y_one = pm.Uniform("y_one", 1-epsilon, 1)
y_beta = pm.Beta("y_beta", alpha=precision * m, beta=(1 - m) * precision)
Now as per the requirements I have, I cannot simply put a single value of m in this equation. I have to instead use an array of m’s derived using the input data. PyMC3 promptly complains that this is not the right approach to this problem. How could one tackle this issue?
I have the BUGS script here in case that would provide more context,
"
model{
# priors
zero0 ~ dnorm(priors.zero_mu0, 1 / (priors.zero_sd0 ^ 2))
zero1 ~ dnorm(priors.zero_mu1, 1 / (priors.zero_sd1 ^ 2))
one0 ~ dnorm(priors.one_mu0, 1 / (priors.one_sd0 ^ 2))
one1 ~ dnorm(priors.one_mu1, 1 / (priors.one_sd1 ^ 2))
b0 ~ dnorm(priors.b0_mu, 1 / (priors.b0_sigma ^ 2))
b1 ~ dnorm(priors.b1_mu, 1 / (priors.b1_sigma ^ 2))
phi ~ dunif(0, 100)
# eqs 6, 7
for (i in 1:n) {
logit(alpha_zero[i]) <- zero0 + zero1 * x[i]
y.iszero[i] ~ dbern(alpha_zero[i])
logit(alpha_one[i]) <- one0 + one1 * x[i]
y.isone[i] ~ dbern(alpha_one[i])
}
for (i in 1:n.zero) {
y.zero[i] ~ dbern(0)
}
for (i in 1:n.one) {
y.one[i] ~ dbern(1)
}
# likelihood for mu and phi (precision) - probit link function
for (i in 1:n.cont) {
y.c[i] ~ dbeta(p[i], q[i])
p[i] <- mu2[i] * phi
q[i] <- (1 - mu2[i]) * phi
probit(mu2[i]) <- (1 / b0) * log(x.c[i] / b1)
}
}
"
The x’s here are the input data I am referring to.
Thanks in advance!