#8732: bug in new HMM code
--------------------------+-------------------------------------------------
Reporter: was | Owner: amhou
Type: defect | Status: new
Priority: blocker | Milestone: sage-4.4
Component: statistics | Keywords:
Author: | Upstream: N/A
Reviewer: | Merged:
Work_issues: |
--------------------------+-------------------------------------------------
Crap, there is a bug in the new HMM code (#8547) that just went into
sage-4.4.alpha0:
Try this:
{{{
sage: m = hmm.DiscreteHiddenMarkovModel([[1/3]*3]*3, [ [5]*5 ]*3, [1/3]*3,
'abcde'); m
sage: v = list('a'*100); v
sage: m.baum_welch(v)
sage: m.sample(10)
['e', 'a', 'e', 'e', 'a', 'c', 'c', 'c', 'c', 'a']
sage: m
Discrete Hidden Markov Model with 3 States and 5 Emissions
Transition matrix:
[0.333333333333 0.333333333333 0.333333333333]
[0.333333333333 0.333333333333 0.333333333333]
[0.333333333333 0.333333333333 0.333333333333]
Emission matrix:
[1.0 0.0 0.0 0.0 0.0]
[1.0 0.0 0.0 0.0 0.0]
[1.0 0.0 0.0 0.0 0.0]
Initial probabilities: [0.3333, 0.3333, 0.3333]
}}}
Notice above that it is impossible for the model to emit anything except
'a'. Yet in the sample it does!
This bug wasn't in the previous HMM code, of course. I'll fix this ASAP
for sage-4.4.
William
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/8732>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sage-trac?hl=en.