Hidden Markov model most probable state path
STATES = hmmviterbi(seq,TRANS,EMIS)
hmmviterbi(...,'Symbols',SYMBOLS)
hmmviterbi(...,'Statenames',STATENAMES)
STATES = hmmviterbi(seq,TRANS,EMIS)
given
a sequence, seq
, calculates the most likely path
through the hidden Markov model specified by transition probability
matrix, TRANS
, and emission probability matrix EMIS
. TRANS(i,j)
is
the probability of transition from state i
to state j
. EMIS(i,k)
is
the probability that symbol k
is emitted from state i
.
Note
The function |
hmmviterbi(...,'Symbols',SYMBOLS)
specifies
the symbols that are emitted. SYMBOLS
can be a
numeric array or a cell array of the names of the symbols. The default
symbols are integers 1
through N
,
where N
is the number of possible emissions.
hmmviterbi(...,'Statenames',STATENAMES)
specifies
the names of the states. STATENAMES
can be a numeric
array or a cell array of the names of the states. The default state
names are 1 through M
, where M
is
the number of states.
trans = [0.95,0.05; 0.10,0.90]; emis = [1/6 1/6 1/6 1/6 1/6 1/6; 1/10 1/10 1/10 1/10 1/10 1/2]; [seq,states] = hmmgenerate(100,trans,emis); estimatedStates = hmmviterbi(seq,trans,emis); [seq,states] = ... hmmgenerate(100,trans,emis,... 'Statenames',{'fair';'loaded'}); estimatesStates = ... hmmviterbi(seq,trans,emis,... 'Statenames',{'fair';'loaded'});
[1] Durbin, R., S. Eddy, A. Krogh, and G. Mitchison. Biological Sequence Analysis. Cambridge, UK: Cambridge University Press, 1998.