Professional Documents
Culture Documents
23 May 2014
1/31
Alexis Huet
2/31
Outline
Real applications
Alexis Huet
3/31
Markov chains
Hidden Markov models
Issues
Outline
Real applications
Alexis Huet
Markov chains
Hidden Markov models
Issues
Markov chains
We consider the following state space : (Rn , L(Rn )).
Definition
A sequence of random variables (Xk )kN taking values in Rn is a
Markov chain if for all k 1, x0 , . . . xk1 Rn and A L(Rn ) :
P(Xk A|Xk1 = xk1 , . . . , X0 = x0 ) = P(Xk A|Xk1 = xk1 ).
Hypothesis
In the sequel, the Markov chain is homogeneous and admits a
family of density functions (p(.|x))xRn such that :
Z
P(Xk A|Xk1 = xk1 ) =
p(xk |xk1 )dxk .
A
4/31
Alexis Huet
Markov chains
Hidden Markov models
Issues
Example
The state space is here R2 . For all x R2 , let B(x, 1) be the unit
ball centered in x.
Definition
For all x R2 , the distribution Unif (B(x, 1)) is defined by its
density :
1
1(. B(x, 1)).
Alexis Huet
Markov chains
Hidden Markov models
Issues
0
2
ord
Example
abs
6/31
Alexis Huet
Markov chains
Hidden Markov models
Issues
Example
0
2
ord
abs
6/31
Alexis Huet
Markov chains
Hidden Markov models
Issues
Example
0
2
ord
abs
6/31
Alexis Huet
Markov chains
Hidden Markov models
Issues
Example
ord
abs
6/31
Alexis Huet
Markov chains
Hidden Markov models
Issues
Example
ord
abs
6/31
Alexis Huet
Markov chains
Hidden Markov models
Issues
Example
ord
abs
6/31
Alexis Huet
Markov chains
Hidden Markov models
Issues
Example
03
ord
6
1
abs
6/31
Alexis Huet
Markov chains
Hidden Markov models
Issues
Definition
(Xk , Yk )k0:m1 is a hidden Markov model if : (Xk )k0:m1 is a
Markov chain, (Yk )k0:m1 are independent conditionally to
(Xk )k0:m1 and for all k, Yk depends only on Xk .
Schematically, we have :
7/31
X0
X1
X2
. . . Xm1
y
y .
Y0
Y1
Y2
...
Alexis Huet
Ym1
Markov chains
Hidden Markov models
Issues
Example
N (0, 2 ).
8/31
Alexis Huet
Markov chains
Hidden Markov models
Issues
Example ( = 0.1)
03
03
2 4
ord
5 1
6
8
abs
9/31
Alexis Huet
Markov chains
Hidden Markov models
Issues
Example ( = 0.1)
03
ord
6
9
abs
10/31
Alexis Huet
Markov chains
Hidden Markov models
Issues
Issues
Now, the hidden chain (xk ) is unknown and we only have the
observations (yk ).
Aim : reconstitute x0:m1 := (x0 , . . . , xm1 ) conditionally to the
observations.
Specifically, to generate a sample according to the following
density :
p(x0:m1 |y0:m1 )dx0:m1 .
11/31
Alexis Huet
Outline
12/31
Real applications
Alexis Huet
1
p(x0 , y0 )
=
p(y0 |x0 )p(x0 ).
p(y0 )
p(y0 )
13/31
Alexis Huet
1
p(y0 |x0 )p(x0 )dx0 .
p(y0 )
(N)
x0 , . . . , x0 .
Compute for each particle j :
(j)
w0 =
1
(j)
p(y0 |x0 ).
p(y0 )
(j)
The sample (
x0 )j1:N which approximates p(x0 |y0 )dx0 is :
N
X
j=1
14/31
(j)
w0
PN
(j)
(j 0 ) x0
j 0 =1 w0
Alexis Huet
(dx0 ).
1
p(y0 |x0 )p(x0 )dx0 .
p(y0 )
(N)
x0 , . . . , x0 .
Compute for each particle j :
(j)
(j)
w0 = p(y0 |x0 ).
(j)
The sample (
x0 )j1:N which approximates p(x0 |y0 )dx0 is :
N
X
j=1
15/31
(j)
w0
(j)
(j 0 ) x0
j 0 =1 w0
PN
Alexis Huet
(dx0 ).
Example (SIS) N = 20
0.070.93
0.00
0.00
0.00
0.00
ord
0.00
0.00
0.00
0.00
0.00
0.00
0.00
0.000.00
0.00
0.00
0.00
0.00
0.00
1.0
0.5
0.0
0.5
1.0
1.5
abs
16/31
Alexis Huet
2.0
wi
(j)
(j)
(j)
The sample (
x1:i )j1:N which approximates p(x1:i |yi )dx1:i is :
N
X
j=1
17/31
(j)
wi
PN
(j)
(j 0 ) x1:i
j 0 =1 wi
Alexis Huet
(dx1:i ).
Example (SIS) N = 20
0.070.93
0.00
0.00
0.00
0.00
ord
0.00
0.00
0.00
0.00
0.00
0.00
0.00
0.000.00
0.00
0.00
0.00
0.00
0.00
1.0
0.5
0.0
0.5
1.0
1.5
abs
18/31
Alexis Huet
2.0
Example (SIS) N = 20
0.00
0.00
0.00
0.00
0.00
ord
0.00
0.00
0.00
0.00
0.00
0.00
1.00
0.00
0.00
0.00
0.00
0.00
0.00
0.00
0.00
1.0
0.5
0.0
0.5
1.0
1.5
abs
18/31
Alexis Huet
2.0
Example (SIS) N = 20
1.00
0.00
0.00
0.00
ord
0.00
0.00
0.00
0.00
0.00
0.00
0.00
0.00
0.00
0.00
0.00
0.00
0.00
0.00
0.00
0.00
1.0
0.5
0.0
0.5
1.0
1.5
abs
18/31
Alexis Huet
2.0
Convergence :
for m the length of the chain fixed, central limit theorem
when the number of particles N +.
Degeneracy problem :
many particles have a relative weight close to 0%,
for N fixed, from a certain number of sites, only one particle
has an important relative weight.
Resampling of the particles.
19/31
Alexis Huet
1
p(y0 |x0 )p(x0 )dx0 .
p(y0 )
(N)
x0 , . . . , x0 .
Compute for each particle j :
(j)
(j)
w0 = p(y0 |x0 ).
(j)
Generate (
x0 )j1:N from :
N
X
j=1
(j)
w0
(j)
and let (w
0 )j1:N 1.
20/31
(j)
(j 0 ) x0
j 0 =1 w0
PN
Alexis Huet
(dx0 )
wi
(j)
(j)
(j)
=w
i1 p(yi |xi ) = p(yi |xi ).
(j)
Generate (
xi )j1:N from :
N
X
j=1
(j)
wi
(j)
and let (w
i )j1:N 1.
21/31
(j)
(j 0 ) xi
j 0 =1 wi
PN
Alexis Huet
(dxi )
Example (SISR)
1.0
0.00
0.00
0.00
0.00
0.00
0.00
0.72
0.00 0.28
0.00
0.00
0.00
0.0
ord
0.5
0.00
0.00
0.00
0.00
0.5
0.00
0.00
0.00
0.00
1.0
1.0
0.5
0.0
0.5
abs
22/31
Alexis Huet
1.0
1.0
Example (SISR)
0.0
1.0
0.5
ord
0.5
0.05
0.05
1.0
0.5
0.0
0.5
abs
22/31
Alexis Huet
1.0
Example (SISR)
0.00
1.0
0.00
0.00
0.00
0.00
0.00
0.00
0.00
0.00
0.00
0.5
0.00
0.00
0.04
0.03
0.22
0.36
0.35
0.0
ord
0.00
0.00
0.00
1.0
0.5
1.0
0.5
0.0
0.5
abs
22/31
Alexis Huet
1.0
1.0
Example (SISR)
0.5
0.0
1.0
0.5
ord
0.05
0.05
0.05
0.05
1.0
0.5
0.0
0.5
abs
22/31
Alexis Huet
1.0
Convergence (SISR)
23/31
Alexis Huet
Example
Comparison with m = 100 sites and N = 10000 particles.
84 85
4
90
80
97
86
82
96
9883
81
87
99
95
94
88
92
93
89
91
79
78
77
74
75
73
76
72
03
4
71
5 1
67
ord
270
68
69
66
61
65
10
6
7
12 63
11
1713
18 62
8
19
60 9
14
64
59 36 38
20
2829 33
22
16
15
32
35
23
58 34
24
37
39
48
47
21
40
26 3027 49 31
25
43
57
56
46
44
55
45
50
54
53
51
52
abs
24/31
Alexis Huet
41
42
Example (SIS)
24/31
Alexis Huet
Example (SISR)
24/31
Alexis Huet
Example (SIS)
25/31
Alexis Huet
Example (SISR)
25/31
Alexis Huet
Outline
26/31
Real applications
Alexis Huet
Path tracking
27/31
Alexis Huet
28/31
Alexis Huet
Phylogenetic analysis
29/31
Alexis Huet
Phylogenetic analysis
30/31
t = 1
ACGAGGTGA
ACAAGGTGA
ACAGGGTGA
ACAGGGCGA
ACAGGGCAA
t=0
ACAGGGCAA
Alexis Huet
Phylogenetic analysis
30/31
i
t = 1
1
A
A
A
A
A
2
C
C
C
C
C
3
G
A
A
A
A
4
A
A
G
G
G
5
G
G
G
G
G
6
G
G
G
G
G
7
T
T
T
C
C
8
G
G
G
G
A
9
A
A
A
A
A
t=0
Alexis Huet
Phylogenetic analysis
30/31
i
t = 1
1
?
?
?
?
?
2
?
?
?
?
?
3
?
?
?
?
?
4
?
?
?
?
?
5
?
?
?
?
?
6
?
?
?
?
?
7
?
?
?
?
?
8
?
?
?
?
?
9
?
?
?
?
?
t=0
Alexis Huet
31/31
Alexis Huet