-
-
Notifications
You must be signed in to change notification settings - Fork 5.1k
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/ENH: Explain limitations of stats.levy_stable more explicitly #8289
Conversation
Cross-ref #7374 |
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.
Hi,
having these comments is definitely an improvement. I added a few remarks...
scipy/stats/_continuous_distns.py
Outdated
|
||
The distribution for `levy_stable` is parametrized by | ||
:math:`0 < a \leq 2` and :math:`-1 \leq b \leq 1`. Its probability | ||
density function cannot be expressed analytically, but is described by |
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.
"function cannot be expressed analytically" --> "function cannot be expressed analytically (except in some special cases)"
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.
I agree
Sure, I'll do that early next week. About #7374 - is the new |
Thanks for the update. I don't know the implementation of 7374, my guess is that the special cases use simpler methods. |
de54c17
to
76d1a55
Compare
OK, I think it's good but my rebase skills are shaky so we'll see. |
76d1a55
to
e9c4177
Compare
Once the rebase is successful in your local repo, you need to force the push. https://stackoverflow.com/questions/5509543/how-do-i-properly-force-a-git-push |
OK I'm pretty sure I've got it now. |
ENH: On failure, suggest using an equivalent distribution if possible. Minor PEP8 fix. Corrections suggested by @chrisb83 I think I'm undoing something?
see also section.
e9c4177
to
f622438
Compare
It's been a while but I think this still applies. |
[skip azp] [skip actions]
Miraculously, Sphinx rendered the table exactly as I would have hoped. Here's a direct link to the artifact. |
We do specialize for most of those cases. E.g. scipy/scipy/stats/_levy_stable/__init__.py Lines 190 to 211 in 5ec3c62
That said, I feel it wise to recommend the equivalent distributions where possible. There might optimisations, better consideration of numerics etc. That table makes it clear. |
Thanks. If that looks like a good place for it, I'll merge. |
I also agree that this information is useful and could be added to the documentation. Wikipedia has a few more special cases (Landau and Holtsmark distributions) and analytic cases (using Bessel functions, hypergeometric functions, Fresnel integrals, etc.) for any particularly interested readers. |
I also think the current location in the notes is reasonable -- it essentially comes at the end of the distribution overview and right before the more technical implementation details. |
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.
This looks good to me. The information is useful and I also agree with its placement in the notes.
OK. I'll go ahead and merge as-is, and if we want to add additional information later, we can. Thanks @jcalbert and all! |
In response to #8263 - makes the documentation of stats.levy_stable more descriptive.