-
-
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
implement cdf/sf for logser distribution #3890
Comments
I just wanted to add the cdf which uses the incomplete beta function. however, it uses the "unregularized" beta function denoted B(x; a,b) on Wikipedia while Any chance that the "unscaled" version can be added without too much trouble? Derivation of the CDF:
Note that integration with a = 0 is not a problem here as p < 1. But |
We only need a special case of the incomplete beta function B(x; a, b), with a = k +1 and b = 0. Plugging those values into the integral form of the beta function gives (using
According to Wolfram Alpha, that integral can be expressed in terms of the hypergeometric function ₂F₁:
We have ₂F₁ implemented as
Compare the calculation to the existing implementation:
Looks good.
|
It turns out I won't create a PR. |
@steppi I imagined (then saw) that you might be interested in |
Not yet. So far I've only touched the implementation for complex That being said, the special cases of |
I see. Speaking of Boost, is there anything there that could be used? It's relatively easy to add boost stuff to SciPy now. |
I just checked, and yes actually. Boost has an implementation of the unregularized incomplete beta function. See here. |
@mckib2 Are these easy to include, too? |
Log-series distribution has a closed form expression for cdf in terms of an incomplete beta function, http://en.wikipedia.org/wiki/Logarithmic_distribution.
Implementing could address a cryptic comment,
in https://github.com/scipy/scipy/blob/master/scipy/stats/_discrete_distns.py#L360.
A well hidden ticket, #1883 reporting a problem with
stats.logser.sf(np.inf, 0.5)
, can be related.The text was updated successfully, but these errors were encountered: