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

DOC: special: Add documentation for betainc function #10682

Merged
merged 2 commits into from Aug 20, 2019

Conversation

lhilt
Copy link
Contributor

@lhilt lhilt commented Aug 17, 2019

Reference issue

None.

What does this implement/fix?

Adds a definition, a parameter description, a reference, and some examples of special.betainc satisfying some known properties.

Additional information

None.

@pvanmulbregt pvanmulbregt added Documentation Issues related to the SciPy documentation. Also check https://github.com/scipy/scipy.org scipy.special labels Aug 18, 2019
Copy link
Contributor

@pvanmulbregt pvanmulbregt left a comment

Choose a reason for hiding this comment

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

Thanks for adding the documentation. Just a couple of small changes/additions requested and then it should be good to go.

-------
array-like
Value of the incomplete beta function

Copy link
Contributor

Choose a reason for hiding this comment

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

Suggest adding a "See also:" block here, referring to beta, betaincinv.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done!

incomplete beta. Under this definition, you can get the incomplete beta by
multiplying the result of the scipy function by beta(a, b).
The incomplete beta function is also sometimes defined
without the terms in gamma, in which case the above
Copy link
Contributor

Choose a reason for hiding this comment

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

Perhaps "... without the Gamma terms ..."?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure. I also made it link to the gamma doc using backticks.

>>> sc.betainc(9, 0.1, 1.0)
1.0
>>> sc.betainc(0.0003, 7.4, 1.0)
1.0
Copy link
Contributor

Choose a reason for hiding this comment

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

There are 3 examples here showing I_x(a, b) = 1 and one is probably sufficient. Suggest using the space to show other relations, such as to the hypergeometric function. E.g. https://dlmf.nist.gov/8.17#ii
:math:I_x(a, b) = x^a * F(a, 1-b, a+1, x)/ (a * B(a, b))

>>> a, b, x = 0.2, 3.5, 0.5
>>> x**a * sc.hyp2f1(a, 1-b, a+1, x)/(a*sc.beta(a, b)), sc.betainc(a, b, x)
(0.9896206102333263, 0.9896206102333264)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

@person142 person142 merged commit 4c4c29c into scipy:master Aug 20, 2019
@person142 person142 added this to the 1.4.0 milestone Aug 20, 2019
@lhilt lhilt deleted the betainc-doc branch September 4, 2019 17:18
@person142 person142 added the special-docs-marathon Part of the NumFOCUS small grant for special function documentation (Do not delete) label Nov 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Documentation Issues related to the SciPy documentation. Also check https://github.com/scipy/scipy.org scipy.special special-docs-marathon Part of the NumFOCUS small grant for special function documentation (Do not delete)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants