Repository navigation
Viterbi algorithm bug fix: consider states that lead *to* the current state, not reachable *from* it - #3
Merged
1 commit merged intoFeb 14, 2011
Merged
Viterbi algorithm bug fix: consider states that lead *to* the current state, not reachable *from* it#3 1 commit merged into
1 commit merged into
Conversation
… recursive calculation of path probabilities, we need to loop over previous states that have transitions *to* the current state, not states that are reachable *from* the current state. This bug only shows up for non-ergodic models, that is, models where some transitions are not allowed. In an ergodic model, any state is reachable from any other state, so the set of "from" states for a given state is always the same as the set of "to" states; both are equal to the full state alphabet. See the discussion in bug biopython#2947. In support of this bug fix, extend the HiddenMarkovModel to create a dictionary of states with transitions to a given state ("to" transitions) in addition to the existing dictionary of states that are reachable from a given state ("from" transitions). Add unit tests for non-ergodic models, for "to" transitions, and improve the existing "from" transition test to make it more robust. Also remove some unnecessary and inefficient exception throwing.
Member
|
Walter; |
Author
|
Brad - thanks for the code review, will do- |
manulera
pushed a commit
to manulera/biopython
that referenced
this pull request
Oct 6, 2025
Use coordinates in algorithm
This pull request was closed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bug fix related to bug #2947. Please review and commit if it's OK. Thanks,
Walter Gillett