Beruflich Dokumente
Kultur Dokumente
Introduction
Generating a Test Sequence
Estimating the State Sequence
Estimating Transition and Emission Matrices
Estimating Posterior State Probabilities
Observe a sequence of emissions
Do not know the sequence of states the
model went through to generate the
emissions.
Analyses of hidden Markov models seek to
recover the sequence of states from the
observed data.
The model uses:
A red die, having six sides, labeled 1 through
6.
A green die, having twelve sides, five of which
are labeled 2 through 6, while the remaining
seven sides are labeled 1.
A weighted red coin, for which the probability
of heads is .9 and the probability of tails is .1.
A weighted green coin, for which the
probability of heads is .95 and the probability
of tails is .05.
a Markov model with two states and six
possible emissions.
The model creates a sequence of numbers from the
set
{1, 2, 3, 4, 5, 6} with the following rules:
Begin by rolling the red die and writing down the
number that comes up, which is the emission.
Toss the red coin and do one of the following:
If the result is heads, roll the red die and write
down the result.
If the result is tails, roll the green die and write
down the result.
At each subsequent step, you flip the coin
that has the same color as the die you rolled
in the previous step.
If the coin comes up heads, roll the same die
as in the previous step.
If the coin comes up tails, switch to the other
die.
Red coin Green coin
sum(states==likelystates)/100
ans = 0.8200
Using hmmestimate
requires that you know the sequence of
states States that the model went through to
generate seq.
[TRANS_EST, EMIS_EST] =
hmmestimate(seq, states)
TRANS_EST =[ 0.8989 0.1011 0.0585 0.9415]
EMIS_EST =
[0.1721 0.1721 0.1749 0.1612 0.1803 0.1393
0.5836 0.0741 0.0804 0.0789 0.0726 0.1104]