Viterbi algorithm for second order HMM

4k views Asked by At

I am trying to find some (preferably MATLAB) code for the Viterbi algorithm in a 2nd order HMM. I know how to apply it for a first order model, and understand the concept for 2nd order. However I am having trouble implementing it for a 2nd order model. Can anyone give me any good references? I have searched Google and, surprisingly, could not find anything that's reasonably clear.

Also, is there a MATLAB library that already implements this? I know there is one for a first order HMM. Thanks

2

There are 2 answers

0
Jared Forsyth On

I know this is old, but I had this question, and had to figure out the answer myself.

You just need to represent the transition probabilities as P((State_t-2, State_t-1) => (State_t-1, State_t))

You can keep emission probabilities in terms of State_t though (you need a lot of data for 2nd-order emission probabilities to be reasonable).

That should give you reasonable results.

0
Sitaram Ramachandrula On

see this paper https://journals.sagepub.com/doi/pdf/10.1177/1550147718772541

You need to modify viterbi path finding by considering prev and prev-to-prev-state