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

Added some attributes to Markov chain #17046

Merged
merged 6 commits into from Jun 22, 2019

Conversation

Projects
None yet
5 participants
@czgdp1807
Copy link
Member

commented Jun 18, 2019

References to other Issues or PRs

Brief description of what is fixed or changed

Some attributes specific to DiscreteMarkovChain have been added. The names are,

  • is_absorbing_state
  • is_absorbing_chain
  • fixed_row_vector

I will try to add more like, equilibrium_distribution, and some given here.

Other comments

I haven't allowed overriding of information(transition matrix, state space) because these attributes are properties of Markov chain and should be determined by the state of the object and not by what is passed after creation of the object. Though that's my reasoning.

Release Notes

  • stats
    • Attributes specific to DiscreteMarkovChain have been added like, is_absorbing_chain, fixed_row_vector, etc.
@sympy-bot

This comment has been minimized.

Copy link

commented Jun 18, 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
    • Attributes specific to DiscreteMarkovChain have been added like, is_absorbing_chain, fixed_row_vector, etc. (#17046 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
Some attributes specific to `DiscreteMarkovChain` have been added. The names are,

- `is_absorbing_state`
- `is_absorbing_chain`
- `fixed_row_vector`

I will try to add more like, `equilibrium_distribution`, and some given [here](https://docs.google.com/document/d/1oIeaROiJyglpbris7X1uZPRE5ZeO0pD1ygCFhBIeATI/edit#heading=h.4kagr2anaga2).

#### Other comments
I haven't allowed overriding of information(transition matrix, state space) because these attributes are properties of Markov chain and should be determined by the state of the object and not by what is passed after creation of the object. Though that's my reasoning.

#### 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
  * Attributes specific to `DiscreteMarkovChain` have been added like, `is_absorbing_chain`, `fixed_row_vector`, etc.
<!-- END RELEASE NOTES -->

Update

The release notes on the wiki have been updated.

@czgdp1807 czgdp1807 changed the title Added some attributes to Markov chain [WIP] Added some attributes to Markov chain Jun 18, 2019

@codecov

This comment has been minimized.

Copy link

commented Jun 19, 2019

Codecov Report

Merging #17046 into master will increase coverage by 0.028%.
The diff coverage is 85.714%.

@@              Coverage Diff              @@
##            master    #17046       +/-   ##
=============================================
+ Coverage   74.411%   74.439%   +0.028%     
=============================================
  Files          622       622               
  Lines       160859    160989      +130     
  Branches     37758     37802       +44     
=============================================
+ Hits        119697    119839      +142     
+ Misses       35844     35828       -16     
- Partials      5318      5322        +4
@czgdp1807

This comment has been minimized.

Copy link
Member Author

commented Jun 19, 2019

ping @Upabjojr
Please review so that I can proceed accordingly.

@czgdp1807

This comment has been minimized.

Copy link
Member Author

commented Jun 20, 2019

The following attributes have been added in the latest commit:

  • _transient2absorbing()

  • _transient2transient()

  • fundamental_matrix

  • limiting_distribution

Please read the respective doc strings if the meaning is unclear. Thanks

Show resolved Hide resolved sympy/stats/stochastic_process_types.py Outdated
Show resolved Hide resolved sympy/stats/stochastic_process_types.py Outdated

czgdp1807 added some commits Jun 21, 2019

@czgdp1807 czgdp1807 changed the title [WIP] Added some attributes to Markov chain Added some attributes to Markov chain Jun 21, 2019

@czgdp1807

This comment has been minimized.

Copy link
Member Author

commented Jun 21, 2019

The work of this PR is complete. Now, I will work on extending the scope of probability and expectation queries.

@Upabjojr Upabjojr merged commit a9ff6a0 into sympy:master Jun 22, 2019

3 checks passed

codecov/project 74.439% (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
You can’t perform that action at this time.