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

Matrices with random expressions #17306

Merged
merged 6 commits into from Aug 8, 2019

Conversation

@czgdp1807
Copy link
Member

commented Jul 31, 2019

References to other Issues or PRs

Brief description of what is fixed or changed

N/A

Other comments

ping @Upabjojr @sidhantnagpal

Release Notes

  • stats
    • Matrices with random expressions have been added in sympy.stats.
@sympy-bot

This comment has been minimized.

Copy link

commented Jul 31, 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
    • Matrices with random expressions have been added in sympy.stats. (#17306 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. -->


#### Brief description of what is fixed or changed
N/A

#### Other comments
ping @Upabjojr @sidhantnagpal 

#### 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
  * Matrices with random expressions have been added in `sympy.stats`.
<!-- END RELEASE NOTES -->

Update

The release notes on the wiki have been updated.

@codecov

This comment has been minimized.

Copy link

commented Jul 31, 2019

Codecov Report

Merging #17306 into master will increase coverage by 8.066%.
The diff coverage is 77.777%.

@@              Coverage Diff              @@
##            master    #17306       +/-   ##
=============================================
+ Coverage   66.629%   74.696%   +8.066%     
=============================================
  Files          626       631        +5     
  Lines       162402    163170      +768     
  Branches     38099     38281      +182     
=============================================
+ Hits        108208    121882    +13674     
+ Misses       48853     35952    -12901     
+ Partials      5341      5336        -5

czgdp1807 added some commits Aug 2, 2019

"""
eigen_dict = mat.eigenvals()
eigenvals = eigen_dict.keys()
sorted(eigenvals, key=lambda val: eigen_dict[val])

This comment has been minimized.

Copy link
@czgdp1807

czgdp1807 Aug 2, 2019

Author Member

I have tried to make eigenvals canonical by using sorted. @sidhantnagpal will the key(multiplicity of the eigen value ) always work?

This comment has been minimized.

Copy link
@sidhantnagpal

sidhantnagpal Aug 3, 2019

Member

You can get the list (with multiplicity) using:

evs = mat.eigenvals(multiple=True)

and return the result like JointDistributionHandmade(*evs).

This comment has been minimized.

Copy link
@czgdp1807

czgdp1807 Aug 3, 2019

Author Member

Will it always be the same or the order will be random?

This comment has been minimized.

Copy link
@sidhantnagpal

sidhantnagpal Aug 3, 2019

Member

eigenvals internally calls roots which will make same values appear next to each other.

Lambda((l[1], l[2]), exp(-l[1]**2 - l[2]**2)*Product(Abs(l[_i] - l[_j])**2, (_j, _i + 1, 2), (_i, 1, 1))/pi)
"""
if not isinstance(mat, RandomMatrixSymbol):
raise ValueError("%s is not of type, RandomMatrixSymbol.")

This comment has been minimized.

Copy link
@Upabjojr

Upabjojr Aug 6, 2019

Contributor

forgot to fill %s ?

@Upabjojr Upabjojr merged commit 7b38873 into sympy:master Aug 8, 2019

3 checks passed

codecov/project 74.696% (target 0%)
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
sympy-bot/release-notes The release notes look OK
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.