pymc-devs/pymc4

PYMC4.Bound not found

muunetheus opened this issue · 3 comments

Error received when using pymc4.bound():

AttributeError: module 'pymc4' has no attribute 'bound'

Is bound available for PYMC4?

Not yet - contribution welcome :-)

Do you the the equivalent function in TFP? I'm relatively new to TFP, so if you point me in the right direction I can try to contribute :)

Bound in PyMC3 is not proper - we just cut off the density outside of the bound without normalizing the PDF. To replicate this behavior, we can assign a bijector a Bound super class, something like:

class Bound(BoundedDistribution):
    def _init_transform(self, transform):
        if transform is None:
            if self.lower_limit() is not None and self.upper_limit() is None:
                return transforms.LowerBound(self.lower_limit())
            elif self.lower_limit() is not None and self.upper_limit() is not None:
                return transforms.Interval(self.lower_limit(), self.upper_limit())
            elif ...
        else:
            return transform

    def __init__(self, base_distribution, lower, upper):
        ...

    def upper_limit(self):
        ...

    def lower_limit(self):
        ...