Skip to content
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

Assumptions of dependence in random variables #17387

Open
wants to merge 3 commits into
base: master
from

Conversation

@czgdp1807
Copy link
Member

commented Aug 12, 2019

References to other Issues or PRs

#17260

Brief description of what is fixed or changed

The static class DependentPSpace has been added for carrying out computations associated with dependent random variables.

Other comments

ping @Upabjojr
Currently, only, compute_density has been implemented for the added class because in the first commit, I aim to show how the code will look like and take reviews from mentors.

Release Notes

  • stats
    • assumptions of dependence in random variables is supported by sympy.stats
@sympy-bot

This comment has been minimized.

Copy link

commented Aug 12, 2019

Hi, I am the SymPy bot (v147). I'm here to help you write a release notes entry. Please read the guide on how to write release notes.

Your release notes are in good order.

Here is what the release notes will look like:

  • stats
    • assumptions of dependence in random variables is supported by sympy.stats (#17387 by @czgdp1807)

This will be added to https://github.com/sympy/sympy/wiki/Release-Notes-for-1.5.

Note: This comment will be updated with the latest check if you edit the pull request. You need to reload the page to see it.

Click here to see the pull request description that was parsed.

<!-- Your title above should be a short description of what
was changed. Do not include the issue number in the title. -->

#### References to other Issues or PRs
<!-- If this pull request fixes an issue, write "Fixes #NNNN" in that exact
format, e.g. "Fixes #1234". See
https://github.com/blog/1506-closing-issues-via-pull-requests . Please also
write a comment on that issue linking back to this pull request once it is
open. -->
#17260 

#### Brief description of what is fixed or changed
The static class `DependentPSpace` has been added for carrying out computations associated with dependent random variables. 

#### Other comments
ping @Upabjojr 
Currently, only, `compute_density` has been implemented for the added class because in the first commit, I aim to show how the code will look like and take reviews from mentors.

#### Release Notes

<!-- Write the release notes for this release below. See
https://github.com/sympy/sympy/wiki/Writing-Release-Notes for more information
on how to write release notes. The bot will check your release notes
automatically to see if they are formatted correctly. -->

<!-- BEGIN RELEASE NOTES -->
* stats
  * assumptions of dependence in random variables is supported by `sympy.stats`
<!-- END RELEASE NOTES -->

@codecov

This comment has been minimized.

Copy link

commented Aug 12, 2019

Codecov Report

Merging #17387 into master will increase coverage by 0.011%.
The diff coverage is 91.666%.

@@              Coverage Diff              @@
##            master    #17387       +/-   ##
=============================================
+ Coverage   74.681%   74.693%   +0.011%     
=============================================
  Files          631       631               
  Lines       163256    163280       +24     
  Branches     38301     38311       +10     
=============================================
+ Hits        121922    121959       +37     
+ Misses       35991     35986        -5     
+ Partials      5343      5335        -8


@staticmethod
def compute_density(expr, assumps):

This comment has been minimized.

Copy link
@Upabjojr

Upabjojr Aug 14, 2019

Contributor

this method refers to multivariate normal distributions without containing the name Normal. Maybe it can be confusing?

This comment has been minimized.

Copy link
@czgdp1807

czgdp1807 Aug 16, 2019

Author Member

Ah! I just forgot to mention that, I will use getattr to make a function call, like, if some expr has random variables of some X distribution then _compute_MutlivariateXDistribution would be called for construction of distribution. So, compute_density will be a general method making use of private constructors for specific distributions.
Is it a good approach?

This comment has been minimized.

Copy link
@Upabjojr

Upabjojr Aug 18, 2019

Contributor

Well... I would prefer to avoid getattr if possible. Consider the possibility of dispatching either on the class (a.method, b.method, ...) or with multipledispatch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.