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
Different results in expon.cdf and a derived class cdf (with the same pdf as expon). #6185
Comments
Maybe the stats framework assumes that your pdf integrates to 1 over (-infinity, infinity) and is therefore returning a garbage cdf value because it's not sophisticated enough to detect that its assumptions are violated. You could work around that problem by specifying that the support is (0, infinity) using something like the following code. from __future__ import print_function, division
from scipy.stats import rv_continuous, expon
r1 = expon()
class custom_expon(rv_continuous):
def _pdf(self, x):
return r1.pdf(x)
ce = custom_expon(a=0.0, name='custom_expon')
r2 = ce()
x = 4.34
print(r2.cdf(x))
|
@argriffing Thanks. I think this should fix the problem. |
If you're actually doing what your example code does, it is worth noting On Mon, May 23, 2016 at 2:41 PM, argriffing notifications@github.com
|
I think r1.cdf(4.34) and r2.cdf(4.34) should return the exact values. I cannot figure the reason behind the significant difference.
Also, r2.cdf(4.33) < r2.cdf(4.35)
but,
The text was updated successfully, but these errors were encountered: