-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
pdf method of MarginalDistribution syntactically incorrect #15859
Comments
I am studying the stats module so I would like to solve this one. I might take some time though |
Sure! Go ahead! |
@oscargus Is this still an issue? |
Also, Line 323
We are checking if expr is an instance of JointDistribuion
So, I think it will be expr which is an instance of JointDistribution and uses syms as args |
as for syms, it does not look like it is doing anything else in the code, So, I'm trying to see if new tests are required |
I do not think that this is fixed, no. Adding at least one test is required as the incorrect line for sure is not covered now. |
Currently, I am working on this. This is not as simple as it looks. Joint Random Variables in Sympy were implemented last year so they have a lot of vulnerabilities as of now. Tests are quite redundant in terms of checking the working of the module. That is why this will take some time. |
Yeah, no problem. |
I am working on it. |
Lines 315 to 328 in 63ab534
Looking into the issue, I see that all the pointed erros are been resolved in current master. I think we can add a test for the same. |
@Upabjojr @czgdp1807 Please have a look if this can be closed. |
While cleaning up the code, I realized the following problem. However, as I am not that familiar with the stats module and therefore wasn't able to write a test that covers the potential issues, I open an issue.
Consider the method:
sympy/sympy/stats/joint_rv.py
Lines 312 to 328 in d4475ac
The primary issue is
sympy/sympy/stats/joint_rv.py
Line 327 in d4475ac
where
expression
is not defined. Should probably beexpr
. However, looking atsympy/sympy/stats/joint_rv.py
Line 322 in d4475ac
it may be that it should instead be
expr.args[0]
.On
sympy/sympy/stats/joint_rv.py
Lines 314 to 315 in d4475ac
one may replace
args[1]
withrvs
Now,
sympy/sympy/stats/joint_rv.py
Line 315 in d4475ac
is redefined by
sympy/sympy/stats/joint_rv.py
Line 321 in d4475ac
and
sympy/sympy/stats/joint_rv.py
Line 326 in d4475ac
and, hence, it should probably be moved to an
else:
clause just beforesympy/sympy/stats/joint_rv.py
Line 328 in d4475ac
First, though, it would be good to make sure that this code is covered by a few tests since there are many things that are not obvious when just browsing the code. For example, the arguments to
pdf
are redefined on linesympy/sympy/stats/joint_rv.py
Line 325 in d4475ac
which may be OK or just an unfortunate variable naming.
The text was updated successfully, but these errors were encountered: