-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
MAINT/DOC: special.nrdtrimn/nrdtrisd
docstring fixes
#20069
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
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
5ac3d2a
DOC: add examples and fix wrong signature
dschmitz89 5c5f6b4
TST: add test for nrdtrimn
dschmitz89 8af8ecf
TST: test out different argument order
dschmitz89 f622a58
Revert tests
dschmitz89 b2d000c
Merge branch 'main' into normal_dist_cdflib_tests
dschmitz89 ccdcbd7
DOC: add more see also
dschmitz89 ba538bc
TST: fix bad merge
dschmitz89 285611c
Format ..
dschmitz89 1917e2c
Add missing blank lines for clarity in _add_newdocs.py [docs only]
dschmitz89 621d859
Fix arg order [docs only]
dschmitz89 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11069,18 +11069,18 @@ def add_newdoc(name, doc): | |
|
||
add_newdoc("nrdtrimn", | ||
""" | ||
nrdtrimn(p, x, std, out=None) | ||
nrdtrimn(p, std, x, out=None) | ||
|
||
Calculate mean of normal distribution given other params. | ||
|
||
Parameters | ||
---------- | ||
p : array_like | ||
CDF values, in range (0, 1]. | ||
x : array_like | ||
Quantiles, i.e. the upper limit of integration. | ||
std : array_like | ||
Standard deviation. | ||
x : array_like | ||
Quantiles, i.e. the upper limit of integration. | ||
out : ndarray, optional | ||
Optional output array for the function results | ||
|
||
|
@@ -11091,24 +11091,50 @@ def add_newdoc(name, doc): | |
|
||
See Also | ||
-------- | ||
nrdtrimn, ndtr | ||
scipy.stats.norm : Normal distribution | ||
ndtr : Standard normal cumulative probability distribution | ||
ndtri : Inverse of standard normal CDF with respect to quantile | ||
nrdtrisd : Inverse of normal distribution CDF with respect to | ||
standard deviation | ||
|
||
Examples | ||
-------- | ||
`nrdtrimn` can be used to recover the mean of a normal distribution | ||
if we know the CDF value `p` for a given quantile `x` and the | ||
standard deviation `std`. First, we calculate | ||
the normal distribution CDF for an exemplary parameter set. | ||
|
||
>>> from scipy.stats import norm | ||
>>> mean = 3. | ||
>>> std = 2. | ||
>>> x = 6. | ||
>>> p = norm.cdf(x, loc=mean, scale=std) | ||
>>> p | ||
0.9331927987311419 | ||
|
||
Verify that `nrdtrimn` returns the original value for `mean`. | ||
|
||
>>> from scipy.special import nrdtrimn | ||
>>> nrdtrimn(p, std, x) | ||
3.0000000000000004 | ||
|
||
""") | ||
|
||
add_newdoc("nrdtrisd", | ||
""" | ||
nrdtrisd(p, x, mn, out=None) | ||
nrdtrisd(mn, p, x, out=None) | ||
|
||
Calculate standard deviation of normal distribution given other params. | ||
|
||
Parameters | ||
---------- | ||
mn : scalar or ndarray | ||
The mean of the normal distribution. | ||
p : array_like | ||
CDF values, in range (0, 1]. | ||
x : array_like | ||
Quantiles, i.e. the upper limit of integration. | ||
mn : scalar or ndarray | ||
The mean of the normal distribution. | ||
Comment on lines
+11131
to
-11111
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The signature above says There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🤦 done |
||
|
||
out : ndarray, optional | ||
Optional output array for the function results | ||
|
||
|
@@ -11119,7 +11145,32 @@ def add_newdoc(name, doc): | |
|
||
See Also | ||
-------- | ||
ndtr | ||
scipy.stats.norm : Normal distribution | ||
ndtr : Standard normal cumulative probability distribution | ||
ndtri : Inverse of standard normal CDF with respect to quantile | ||
nrdtrimn : Inverse of normal distribution CDF with respect to | ||
mean | ||
|
||
Examples | ||
-------- | ||
`nrdtrisd` can be used to recover the standard deviation of a normal | ||
distribution if we know the CDF value `p` for a given quantile `x` and | ||
the mean `mn`. First, we calculate the normal distribution CDF for an | ||
exemplary parameter set. | ||
|
||
>>> from scipy.stats import norm | ||
>>> mean = 3. | ||
>>> std = 2. | ||
>>> x = 6. | ||
>>> p = norm.cdf(x, loc=mean, scale=std) | ||
>>> p | ||
0.9331927987311419 | ||
|
||
Verify that `nrdtrisd` returns the original value for `std`. | ||
|
||
>>> from scipy.special import nrdtrisd | ||
dschmitz89 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
>>> nrdtrisd(mean, p, x) | ||
2.0000000000000004 | ||
|
||
""") | ||
|
||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.