- edited description
Missing state in markov.chain_from_seq
The markov.chain_from_seq function does not include the last state given in argument, should this state has not been encountered earlier. For instance,
from lea import markov
mc = markov.chain_from_seq("ABC")
print (mc.states)
# ->('A', 'B')
This may cause erroneous results in other markov.Chain methods. Actually, since there is no example of transition from this last state, a special treatment is required, which should be either raising an exception or giving arbitrary probabilities.
Analysis: if such case occurs, then the last state will be arbitrarily considered to be absorbing, i.e. the next state is itself with probability 1. This choice should be duly documented.
Comments (5)
-
reporter -
reporter Correct and simplify markov.Chain.from_seq method (refs
#45)→ <<cset 7c24cb0ac827>>
-
reporter - changed status to resolved
-
reporter - changed status to closed
-
reporter Correct and simplify markov.Chain.from_seq method (refs
#45)→ <<cset 3db5f96615a5>>
- Log in to comment