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

MarkovProcess object in distribution.py, towards #639 #902

Merged
merged 1 commit into from
Jan 7, 2021

Conversation

sbenthall
Copy link
Contributor

@sbenthall sbenthall commented Jan 5, 2021

See #639

This puts a tested MarkovProcess class into distribution for handling sampling from Markov arrays.

The code demonstrates how to turn a general Python function into a numpy function that can broadcast over an array.

It uses the numpy random number generator to sample based on an array of weights instead of coding that up manually with cumsum and searchsorted.
https://numpy.org/doc/stable/reference/random/generated/numpy.random.RandomState.choice.html?highlight=choice#numpy.random.RandomState.choice

One this is merged in, the next step will be to refactor the Markov model code to use this on the draws.

  • Tests for new functionality/models or Tests to reproduce the bug-fix in code.
  • Updated documentation of features that add new functionality.
  • Update CHANGELOG.md with major/minor changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant