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

Implement BetaNegativeBinomial distribution #258

Merged
merged 15 commits into from
Nov 10, 2023

Conversation

wd60622
Copy link
Contributor

@wd60622 wd60622 commented Nov 3, 2023

Closes this issue

@wd60622
Copy link
Contributor Author

wd60622 commented Nov 3, 2023

Doc rendering
Screenshot 2023-11-03 at 17 52 58

Copy link
Member

@ricardoV94 ricardoV94 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Just a suggestion to ditch the RandomVariable

pymc_experimental/distributions/discrete.py Outdated Show resolved Hide resolved
@wd60622
Copy link
Contributor Author

wd60622 commented Nov 4, 2023

Docs with an image
latest-rendering

@wd60622
Copy link
Contributor Author

wd60622 commented Nov 4, 2023

Thanks for the review @ricardoV94, the implementation mirrors Chi for distribution as well as the tests. Super cool, thanks for the suggestion.
Are those tests sufficient? Are checks for the domain of the random variable or the domains of the parameters? Especially with the switch statement?

@ricardoV94
Copy link
Member

ricardoV94 commented Nov 4, 2023

Are checks for the domain of the random variable or the domains of the parameters? Especially with the switch statement?

Yeah, check_logp covers that

Copy link
Member

@ricardoV94 ricardoV94 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, just a small detail left

pymc_experimental/distributions/discrete.py Outdated Show resolved Hide resolved
@ricardoV94 ricardoV94 changed the title add BetaNegativeBinomial Implement BetaNegativeBinomial distribution Nov 5, 2023
ricardoV94
ricardoV94 previously approved these changes Nov 5, 2023
@ricardoV94
Copy link
Member

ricardoV94 commented Nov 6, 2023

You have a pre-commit failure. The failing test is unrelated and should go away when we rerun them

@wd60622
Copy link
Contributor Author

wd60622 commented Nov 7, 2023

I realized I didn't put Skellam or this distribution in the __all__ of __init__.py

@ricardoV94 ricardoV94 self-requested a review November 8, 2023 06:41
@wd60622
Copy link
Contributor Author

wd60622 commented Nov 9, 2023

Thanks for the feedback. I think that everything has been added in

Comment on lines +350 to +352
if rv_size_is_none(size):
mu1, mu2 = pt.broadcast_arrays(mu1, mu2)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ricardoV94 ricardoV94 added the enhancements New feature or request label Nov 10, 2023
@ricardoV94 ricardoV94 merged commit b521e64 into pymc-devs:main Nov 10, 2023
6 checks passed
@wd60622 wd60622 deleted the add_beta_negative_binomial branch November 10, 2023 18:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancements New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ENH: Beta negative binomial distribution
2 participants