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
Conversation
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.
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 | ||
|
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.
Suggest adding a "See also:" block here, referring to beta
, betaincinv
.
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.
Done!
scipy/special/add_newdocs.py
Outdated
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 |
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.
Perhaps "... without the Gamma terms ..."?
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.
Sure. I also made it link to the gamma doc using backticks.
scipy/special/add_newdocs.py
Outdated
>>> sc.betainc(9, 0.1, 1.0) | ||
1.0 | ||
>>> sc.betainc(0.0003, 7.4, 1.0) | ||
1.0 |
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.
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)
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.
Done.
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.