HiddenMarkovModel FINAL
HiddenMarkovModel FINAL
Dhiraj
DSG-MVL
(1856 -1922)
MARKOV CHAINS
Markov Chain :
Auto Insurance Example
Generics
Markov Chain :
Auto Insurance Example
Markov Chain :
Auto Insurance Example
Markov Chain :
Auto Insurance Example
11
12
13
14
15
16
17
18
19
20
21
22
MARKOV CHAIN
Transient/ephemeral
Recurrent
Absorbing
24
States Going to
Current
States
25
System Behavior
Arriving
Initial State representing Initial Vector
After n time
Units
After One
time Unit
Playing on
Phone
Paying
Attention
26
System Behavior
After Two
time Unit
Playing on
Phone
Paying
Attention
Writing
Notes
Kicked
Out
27
rriving
System Behavior
After 100
time Unit
Playing on Paying
Phone
Attention
Writing
Notes
Listening
Kicked
Out
28
Markov Model
Markov Models
A discrete (finite) system:
N distinct states.
Begins (at time t=1) in some initial state(s).
At each time step (t=1,2,) the system moves
from current to next state according to transition
probabilities associated with current state.
This kind of system is called a finite, or discrete
Markov model
30
Markov Models
Set of states: {s1 , s2 ,, s N }
Process moves from one state to another generating a
sequence of states : si1 , si 2 ,, sik ,
Markov chain property: probability of each subsequent state
depends only on what was the previous state:
Markov Property
Markov Property: The state of the system at time t+1
depends only on the state of the system at time t
P[X t 1 x t 1 | X t x t , X t -1 x t -1 , . . . , X1 x1 , X 0 x 0 ]
P[X t 1 x t 1 | X t x t ]
Xt=1
Xt=2
Xt=3
Xt=4
Xt=5
32
A Markov System
Has N states, called s1, s2 .. sN
s2
s1
N=3
t=0
s3
A Markov System
Has N states, called s1, s2 .. sN
s2
Current State
s1
N=3
t=0
qt=q0=s3
s3
A Markov System
Has N states, called s1, s2 .. sN
Current State
s2
s1
N=3
t=1
qt=q1=s2
s3
P(qt+1=s1|qt=s2) = 1/2
P(qt+1=s2|qt=s2) = 1/2
A Markov System
P(qt+1=s3|qt=s2) = 0
P(qt+1=s1|qt=s1) = 0
P(qt+1=s2|qt=s1) = 0
s2
P(qt+1=s3|qt=s1) = 1
s1
s3
N=3
t=1
qt=q1=s2
P(qt+1=s1|qt=s3) = 1/3
P(qt+1=s2|qt=s3) = 2/3
P(qt+1=s3|qt=s3) = 0
P(qt+1=s1|qt=s2) = 1/2
P(qt+1=s2|qt=s2) = 1/2
A Markov System
P(qt+1=s3|qt=s2) = 0
P(qt+1=s1|qt=s1) = 0
s2
P(qt+1=s2|qt=s1) = 0
1/2
P(qt+1=s3|qt=s1) = 1
2/3
1/2
s1
N=3
t=1
qt=q1=s2
1/3
s3
P(qt+1=s1|qt=s3) = 1/3
P(qt+1=s2|qt=s3) = 2/3
P(qt+1=s3|qt=s3) = 0
Often notated with arcs
between states
P(qt+1=s1|qt=s2) = 1/2
P(qt+1=s2|qt=s2) = 1/2
Markov Property
P(qt+1=s3|qt=s2) = 0
P(qt+1=s1|qt=s1) = 0
s2
P(qt+1=s2|qt=s1) = 0
1/2
P(qt+1=s3|qt=s1) = 1
2/3
1/2
s1
N=3
t=1
qt=q1=s2
1/3
s3
P(qt+1=s1|qt=s3) = 1/3
P(qt+1=s2|qt=s3) = 2/3
P(qt+1=s3|qt=s3) = 0
a44
a34
a23
b14
b13
b12
a33
a22
4
2
Observed
phenomenon
Hidden variables
H1
H2
Hi
HL-1
HL
X1
X2
Xi
XL-1
XL
Observed data
Essentials
To define hidden Markov model, the following
probabilities have to be specified: matrix of
transition probabilities A=(aij), aij= P(si | sj) ,
matrix of observation probabilities
B=(bi (vm )), bi(vm ) = P(vm | si) and a vector of
initial probabilities =(i), i = P(si) . Model is
represented by M=(A, B, ).
45
46
Overview
Mathematical notation
Example : flow chart
Mathematic Notation
To obtain the conditional probability of achieving a
particular state based on previous state
X1,X2,.Xn where X1 represents variable at time 1
P[Xn+1 = j | Xn = i ] = P(i,j)
What is the probability that given the system is in state i and it
will move in state j
47
Mathematical Notation
Probability Matrix
P(0,0): Probability of
0.5
0.5
0
0.5
0
1.0
0.3
0.4
0.3
0.4
0.3
1.0
0.3
2
48
Assumption: A
A
0.1
P=
0.9
0.3
0.9
0.7
A Next State
0.1
0.3
A
Current State
Transition Probability Matrix
0.7
So =
0.2
0.8
0.2
0.8
Start
0.9
0.1
0.7
A
A
0.3
So = 0.2 0.8
S1 = 0.74 0.26
Markov Model
51
Markov Model
52
Markov Model
53
HMM Components
COIN-TOSS MODEL
59
60
61
62
63
64
65
PROBLEM
66
Solution
67
Solution contd.
68
Solution contd.
69
States
Observation
70
71
Learning/Training Problem
Modify
Consider
coins)
Say we get the observations as
{HHHHTTHTTTTHHTT}
So find the model parameters, i.e., transition matrix,
emission matrix and initial distribution that best
represents the output
72
Evaluation Problem
What
Consider
Decoding Problem
What
Say
Baum-Welch Algorithm
Viterbi Training (Unsupervised Learning)
Evaluation:
Forward Algorithm
Decoding:
Forward-Backward Algorithm
Viterbi Algorithm
75
Thank you