You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It looks like the conditional distribution function is not normalized properly on this line. The integral in the denominator should probably be explicitly computed by .doit().
We see Integral(1, (v, 0.5, inf)) which is infinity. So the result of division of v by this integral is 0. Instead of 1, the integral should have a piecewise function there.
The Piecewise object has (nan, True) which should be (0, True). The density outside of the interval [0, 1] is 0, not NaN. Since the outer integral is (correctly) taken from 1/2 to infinity, it includes those NaN values, and so evaluates to NaN.
I tried to calculate the conditional expectation of a random variable:
this returns correctly 1/2, but then:
returns NaN. I also tried:
it returned 1/2, which is incorrect (it should be 3/4).
I asked in Stack Overflow, and was told that:
shows that SymPy understands the input and sets up an integral for it; but it fails to evaluate it if .doit() is invoked on the integral.
The text was updated successfully, but these errors were encountered: