Skip to content

Future of pm.Bound? #4800

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

Closed
ricardoV94 opened this issue Jun 22, 2021 · 0 comments
Closed

Future of pm.Bound? #4800

ricardoV94 opened this issue Jun 22, 2021 · 0 comments
Labels

Comments

@ricardoV94
Copy link
Member

ricardoV94 commented Jun 22, 2021

I think @kc611 plans to refactor pm.Bound to V4 as part of his GSOC project.

Some previous issues have been raised in #4643 and #1864

I am of the opinion that pm.Bound should be changed (if not deprecated altogether) to simply add a custom interval transform (for continuous distributions) and a pm.Potential with a -inf term for values outside of the bounds (more important for the discrete distributions which cannot be transformed). Importantly pm.Bound should not be allowed to sample from in prior/posterior predictive, due to the limitations explained in #4643. This happens because "bounded" variables are not always conditionally independent from other variables (and vice-versa).

Adding the explicit pm.Potential would raise a warning during predictive sampling, but I feel it wouldn't be clear enough for users where it's coming from, and in what situations it can be safely ignored (i.e., when bounded variables have constant input parameters). Alternatively, we could also raise an explicit UserWarning when a bounded variable is initialized with variable inputs.

A more useful effort would be to add Truncated variables which can be obtained from the logcdf methods that exist for nearly all univariate variables, and which can be directly (if not very efficiently) sampled from. They can also be "observed". Truncated variables are not exactly the same as Bounded variables, but (often) they achieve the same goal and are easier to reason about (citation needed)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant