Understanding error while sampling a model with conditional probabilities

Sure! What I just did is:

pis = dist.beta.rvs(4/15, 1, size=15)
bs = dist.bernoulli.rvs(pis)
ns = dist.norm.rvs(0,1, size=15)
errs = dist.norm.rvs(-999, 1e-10, size=15)
vs = []
for b, n, e in zip(bs, ns, errs):
    if b == 0:
        mu = n
    else:
        mu = e
    vs.append(dist.norm.rvs(mu, 1))

With the variables you provided, your dummy data will generate a lot of -999. On the other hand, the Beta distribution generates a lot of very small values. These are somewhat not compatible. I suspect the model is too tightly constained as it is. Tryu puting an hyperprior on the first parameter of the Beta.

2 Likes