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

Add alternative parameterization to negative binomial distribution? #4126

Closed
ricardoV94 opened this issue Sep 23, 2020 · 2 comments
Closed

Comments

@ricardoV94
Copy link
Member

The current parameterization in terms of mu and alpha is very useful in relation to the less flexible Poisson distribution.

However, the negative binomial distribution is often discussed in terms of the number of failures observed until a target number of successes is reached. In this case it is usually parameterized by a parameter p (the probability of observing a success in each trial), and a parameter n (the target number of successes). Would it make sense to add this alternative parameterization to the Negative Binomial distribution?

  • n is equivalent to the alpha parameter
  • p is equivalent to n / (n + mu) or, equivalently, mu = n(1-p)/p

This parameterization is implemented and discussed in the R implementation

@twiecki
Copy link
Member

twiecki commented Sep 23, 2020

Great, want to do a PR @ricardoV94?

@ricardoV94
Copy link
Member Author

I can try :)

twiecki pushed a commit that referenced this issue Oct 1, 2020
 (#4134)

* Add alternative parameters p and n

* Update Release Notes

* Add test

* Add test for invalid initializations

* Refactor tests with pytest.mark.parametrize

* Minor change
@twiecki twiecki closed this as completed Oct 4, 2020
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