Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mixture of discrete and contiuous distributions #3582

Open
aseyboldt opened this issue Aug 8, 2019 · 1 comment

Comments

@aseyboldt
Copy link
Member

commented Aug 8, 2019

Our samplers won't work correctly (except perhaps ABC) for variables that are neither discrete nor continuous. We should not allow the creation of such variables or we should throw and error when sampling from the model.

with pm.Model() as model:
    zero = pm.Constant.dist(DELTA)
    w = pm.Dirichlet('w', a=np.array([1,1]))

    # Should throw an error
    pm.Mixture("log_dist", w=w, comp_dists=[zero, nonzero])

    # TODO is this working correctly?
    pm.Mixture("log_obs", w=w, comp_dists=[zero, nonzero], observed=samples)

See
https://discourse.pymc.io/t/sampling-from-a-learned-mixture-of-zeros-and-lognormal/3671

@junpenglao

This comment has been minimized.

Copy link
Member

commented Aug 9, 2019

Yeah in general I dont think the mixture class should support components that have different support - this invalidate the mixture distribution assumption - but I am not sure what is the best way to enforce this, we can check the domain if the comp_dist are pymc3 distributions, but if it is user supply density function there is no way to know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.