I am trying to define a mixture of bounded random variables e.g.
with pm.Model() as model:
w = w = pm.Dirichlet("w", a=np.ones(3))
upper_sig = pm.HalfNormal("upper_sig", sigma=0.2)
lower_sig = pm.HalfNormal("lower_sig", sigma=0.2)
efficiencies = pm.Mixture(
"efficiencies",
w=w,
comp_dists=[
pm.Bound(pm.Normal, lower=1.0).dist(mu=1.0, sigma=upper_sig),
pm.Bound(pm.Normal, lower=0.0, upper=1.0).dist(mu=1.0, sigma=lower_sig),
pm.Uniform.dist(lower=0.0, upper=1.0),
],
observed=data,
)
but I am getting the following error:
TypeError: __new__() missing 1 required positional argument: 'dist'
Issue seems related to Using a bounded variable within a Mixture - Questions - PyMC Discourse - however, in the discussion it was mentioned the approach wouldn’t work for latest version of the code.