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

P(X < oo ) for any Continuous Distribution raises AttributeError #10052

Closed
gxyd opened this Issue Oct 27, 2015 · 0 comments

Comments

Projects
None yet
1 participant
@gxyd
Copy link
Member

gxyd commented Oct 27, 2015

>>> from sympy import *
>>> from sympy.stats import P, Exponential
>>> X = Exponential('X', 3)
>>> P(X < oo)

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-5-c320871e22f8> in <module>()
----> 1 P(X < oo)

/home/gxyd/Public/sympy/sympy/stats/rv.py in probability(condition, given_condition, numsamples, evaluate, **kwargs)
    617 
    618     # Otherwise pass work off to the ProbabilitySpace
--> 619     result = pspace(condition).probability(condition, **kwargs)
    620     if evaluate and hasattr(result, 'doit'):
    621         return result.doit()

AttributeError: 'NoneType' object has no attribute 'probability'

gxyd pushed a commit to gxyd/sympy that referenced this issue Oct 27, 2015

gxyd pushed a commit to gxyd/sympy that referenced this issue Oct 27, 2015

gxyd pushed a commit to gxyd/sympy that referenced this issue Oct 28, 2015

gxyd pushed a commit to gxyd/sympy that referenced this issue Oct 28, 2015

Gaurav Dhingra
P(X < oo) and P(X > oo) for True probability
fixes sympy#10052

P(1) or similar(nonsensical) probabilities handled

given(x) for non-RadomSymbol `x` raise ValueError instead returning None

test-case added and error message corrected

skirpichev added a commit to skirpichev/diofant that referenced this issue Jul 16, 2016

P(X < oo) and P(X > oo) for True probability
fixes sympy/sympy#10052

P(1) or similar(nonsensical) probabilities handled

given(x) for non-RadomSymbol `x` raise ValueError instead returning None

test-case added and error message corrected

// edited by skirpichev

Signed-off-by: Sergey B Kirpichev <skirpichev@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment