Professional Documents
Culture Documents
Steven Salzberg
CMSC 828H, Univ. of Maryland
Fall 2010
What is an HMM?
Essentially, an HMM is just
A set of states
A set of transitions between states
Transitions have
A probability of taking a transition (moving from
one state to another)
A set of possible outputs
Probabilities for each of the outputs
HMM notation
The set of all states: {s}
Initial states: SI
Final states: SF
Probability of making the transition
from state i to j: aij
A set of output symbols
Probability of emitting the symbol k
while making the transition from
state i to j: bij(k)
4
S. Salzberg CMSC 828H
Fair
Two
TwoCDF
CDFtables
tables
0.2
0.1
Unfair
States
0.8
0.5
H
0.5
T
0.7
H
0.3
Observation Symbols
HTHHTTHHHTHTHTHHTHHHHHHTHTHH
FFFFFFUUUFFFFFFUUUUUUUFFFFFF
Observation Sequence
State Sequence
Motivation: Given a sequence of H & Ts, can you tell at what times
the casino cheated?
5
S. Salzberg CMSC 828H
Consider the sequence AAACCC, and assume that you observed this
output from this HMM. What sequence of states is most likely?
6
S. Salzberg CMSC 828H
Properties of an HMM
First-order Markov process
st only depends on st-1
However, note that probability
distributions may contain conditional
probabilities
Time is discrete
7
S. Salzberg CMSC 828H
10
S. Salzberg CMSC 828H
An untrained HMM
11
S. Salzberg CMSC 828H
ij
=1
12
S. Salzberg CMSC 828H
b (k) = 1
ij
13
S. Salzberg CMSC 828H
aij = P ( X t +1 = j | X t = i)
14
S. Salzberg CMSC 828H
15
S. Salzberg CMSC 828H
17
S. Salzberg CMSC 828H
18
S. Salzberg CMSC 828H
t=0
1.0
(0.6)(0.8)(1.0)
t=3
0.48
State
4)
(0.
(0.
1)(
0.1
)(0
)
S1
t=2
)
1.0
5)(
(0.
S2
0.0
Output:
+
(0.9)(0.3)(0)
0.20
C
19
S. Salzberg CMSC 828H
t=0
1.0
(0.6)(0.8)(1.0)
0.48
(0.6)(0.2)(0.48)
t=3
.0576
.0756 + .018 = .0756
)(0
( 1.
.5 )
0)
0.0
Output:
+
(0.9)(0.3)(0)
0.20
(0.9)(0.7)(0.2)
S2
.48
)(0
0.5
4)(
(0.
4
(0.
(0.
1
)(0
.1 )
State
(0.
1)(
0.9
(0)
)(0
.2
S1
t=2
.126
.222 + .096 = .222
C
20
S. Salzberg CMSC 828H
1.0
(0.6)(0.8)(1.0)
0.48
(0.6)(0.2)(0.48)
t=3
(0.6)(0.2)(.0756)
.0756
.029
.009072
+ .01998 =+.029052
+
Output:
(0.9)(0.3)(0)
(0.
1)(
0.9
)(0
.2
(0.
1)(
0.9
+
+
.222 + (0.9)(0.7)(0.222)
.01512 = .15498
.155
(0.9)(0.7)(0.2).13986
)
0.0
56)
.0)
)(1
0.5
4)(
(0.
S2
.07
)(0
0.5
4)(
(0.
State
.48
)(0
0.5
4)(
(0.
(0.
1)(
0.1
)(0
)
)(0
.2
S1
t=2
22)
t=0
0.20
C
21
S. Salzberg CMSC 828H
T
1
T
1
All paths:
T +1
1
T +1
1
22
S. Salzberg CMSC 828H
T
1
T +1
1
T +1
1
=x
T
1
T
1
T +1
1
)P(Y = y | X
T +1
1
=x
x1T +1
23
S. Salzberg CMSC 828H
P(X
T +1
1
=x
) = P(X t +1 = x t +1 | X t = x t )
t=1
24
S. Salzberg CMSC 828H
25
S. Salzberg CMSC 828H
P(X
t +1
= x t +1 | X t = x t )P(Yt = y t | X t = x t, X t +1 = x t +1 )
t=1
26
S. Salzberg CMSC 828H
0 : t = 0 i SI
i ( t ) =
1 : t = 0 i = SI
(t 1)a b (y) : t > 0
ji ji
j j
Where i(t) is the probability that the HMM is in
state i after generating the sequence y1,y2,,yt
27
S. Salzberg CMSC 828H
P(y | M)P(M)
P(M | y) =
P(y)
28
S. Salzberg CMSC 828H