forward and backward and viterbi hmm matlab code
no vote
Four good and test matlab mfile for forward and backward and viterbi algorithm in Hidden markov model % VITERBI Find the most-probable (Viterbi) path through the HMM state trellis. % path = viterbi(prior, transmat, obslik) % % Inputs: % prior(i) = Pr(Q(1) = i) % transmat(i,j) = Pr(Q(t+1)=j | Q(t)=i) % obslik(i,t) = Pr(y(t) | Q(t)=i) % % Outputs: % path(t) = q(t), where q1 ... qT is the argmax of the above expression. % delta(j,t) = prob. of the best sequence of length t-1 and then going to state j, and O(1:t) % psi(j,t) = the best predecessor state, given that we ended up in state j at t