Would replacing inv_logit and bernoulli to bernoulli_logit actually decrease the bias in estimation, increase the efficiency of the computing, or is it to make the code more readable?
The is_discrete variable is modeling whether or not the y is {0, 1}. If it is, then y_discrete is the value (0 or 1) that the discrete variable takes. y is then for all other observations (0, 1).
I was worried about unmodeled gaps, too. We are trying to model alpha, gamma, mu, and phi, however, where the values of 0 and 1 have the probabilities:
(taken from 6 here: https://arxiv.org/pdf/0705.0700.pdf)
That might help explain the is_discrete variable. So if we condition on alpha and then to the if-else, we incorporate the alpha * gamma probability of being one.
I felt that the unmodeled gaps would be an issue, so I tried to model it:
is_discrete ~ bernoulli(alpha);
for (i in 1:n) {
if (is_discrete[i] == 1) {
y[i] ~ bernoulli(gamma[i]);
} else {
y[i] ~ beta(p[i], q[i]);
}
}
But it throws an error for using two different likelihoods, depending on the case?
