Skip to content

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

Merged
merged 2 commits into from
Mar 17, 2023

Conversation

JoKeyser
Copy link
Contributor

@JoKeyser JoKeyser commented Mar 15, 2023

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

  • Added the definition of $B$ to the documentation of the Beta distribution.

@JoKeyser JoKeyser changed the title Add definition of B in documentation for Beta dist Add definition of B in documentation for Beta distribution Mar 15, 2023
@codecov
Copy link

codecov bot commented Mar 15, 2023

Codecov Report

Merging #6604 (0eaf704) into main (bae121a) will increase coverage by 50.75%.
The diff coverage is n/a.

Additional details and impacted files

Impacted file tree graph

@@             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     
Impacted Files Coverage Δ
pymc/distributions/continuous.py 97.69% <ø> (+48.46%) ⬆️

... and 74 files with indirect coverage changes

@michaelosthege michaelosthege added this to the v5.2.0 milestone Mar 16, 2023
@@ -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)}`
Copy link
Member

@ricardoV94 ricardoV94 Mar 16, 2023

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?

Copy link
Contributor Author

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?

Copy link
Member

@ricardoV94 ricardoV94 Mar 16, 2023

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

Copy link
Contributor Author

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:

  1. Option with generic link to the distribution:
    "where B is the Beta function.

    For more information, see https://en.wikipedia.org/wiki/Beta_distribution."

  2. 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.

Copy link
Member

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!

Copy link
Contributor Author

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

@twiecki twiecki merged commit 239da11 into pymc-devs:main Mar 17, 2023
@ricardoV94
Copy link
Member

Thanks @JoKeyser

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants