Skip to content

Future of pm.Bound? #4800

Closed
Closed
@ricardoV94

Description

@ricardoV94

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions