Hi Ali Asghar,
Using Hmm#mostLikelyStateSequence introduces a bias as you only care about one sequence.
I think that what you are looking for is ForwardBackwardCalculator#alphaElement(int t, int i);
the comment of the 'alpha' field should help you figuring out the exact calculation:
/* alpha[t][i] = P(O(1), O(2),..., O(t+1), i(t+1) = i+1 | hmm), that is the
probability of the beginning of the state sequence (up to time t+1)
with the (t+1)th state being i+1. */
Best,
JM
--
You received this message because you are subscribed to the Google Groups "Jahmm HMM library" group.
To view this discussion on the web visit https://groups.google.com/d/msg/jahmm-discuss/-/8NlPrxFqPCcJ.
To post to this group, send email to jahmm-...@googlegroups.com.
To unsubscribe from this group, send email to jahmm-discus...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/jahmm-discuss?hl=en.
ForwardBackwardCalculator fbc = new ForwardBackwardCalculator(seq, hmm);
if (fbc.alphaElement(endOfSequence, 1) > fbc.alphaElement(endOfSequence, 0)) {
// We are in state 1
} else {
// We are in state 0
}
ForwardBackwardCalculator
Hi,
What you did seem perfectly fine.
If I were you I'd try to see if all the observations of the sequence have a probability higher than zero to match a state: for each state s, for each observation o, display hmm.getOpdf(s).probability(o).
This should give you a clue about what's going on.
Jean-Marc