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

PYMC4.Bound not found #319

Open
muunetheus opened this issue Sep 3, 2020 · 3 comments
Open

PYMC4.Bound not found #319

muunetheus opened this issue Sep 3, 2020 · 3 comments

Comments

@muunetheus
Copy link

Error received when using pymc4.bound():

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

Is bound available for PYMC4?

@junpenglao
Copy link
Member

Not yet - contribution welcome :-)

@muunetheus
Copy link
Author

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 :)

@junpenglao
Copy link
Member

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):
        ...

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

2 participants