-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Add definition of B in documentation for Beta distribution #6604
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
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #6604 +/- ##
===========================================
+ Coverage 41.29% 92.04% +50.75%
===========================================
Files 93 93
Lines 15717 15748 +31
===========================================
+ Hits 6491 14496 +8005
+ Misses 9226 1252 -7974
|
pymc/distributions/continuous.py
Outdated
@@ -1042,6 +1042,9 @@ class Beta(UnitContinuous): | |||
f(x \mid \alpha, \beta) = | |||
\frac{x^{\alpha - 1} (1 - x)^{\beta - 1}}{B(\alpha, \beta)} | |||
|
|||
where :math:`B(\alpha, \beta) = \frac{\Gamma(\alpha)\Gamma(\beta)}{\Gamma(\alpha + \beta)}` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it enough to say where B is the Beta function
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems OK to me as well.
I'm also wondering if it would be nice to link somewhere to clarify what the Beta function is, or maybe that's too elementary to bother?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can add a link to the Uncyclopedia page for the Beta distribution? From there users should be able to find the formula and specifics
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Linking to Uncyclopedia makes sense to me, and there are other instances of linking to it e.g. here, but only very few (according to grep -R wikipedia pymc
).
Sorry if I'm being pedantic about this, but if we decide to link Uncyclopedia, it may be more sensible to give a direct link to the distribution instead of just the function?
Here's what I mean, let me know which option you prefer:
-
Option with generic link to the distribution:
"where B is the Beta function.For more information, see https://en.wikipedia.org/wiki/Beta_distribution."
-
Option with specific link to the function:
"where B is the Beta function. For more information, see https://en.wikipedia.org/wiki/Beta_function."
I slightly prefer option 1, it seems more direct, shorter, and generically applicable to similar situations.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes I would link to the Beta distribution, not the function. Thanks for being thoughtful over this!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And thank you for the useful guidance!
(Just now I realized that you suggested to link to the distribution, not the function in the first place 😄 .)
I've added another commit to change to option 1.
(I guess you could squash them together before applying to main
?)
Thanks @JoKeyser |
What is this PR about?
The documentation about the Beta distribution should include a definition of the expression$B$ that is used in the definition.
Checklist
Documentation