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

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

Mixture of discrete and contiuous distributions #3582

aseyboldt opened this issue Aug 8, 2019 · 1 comment

Comments

@aseyboldt
Copy link
Member

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
Copy link
Member

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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants