An approximation for binary Markov random fields

advertisement
An approximation for binary
Markov random fields
Håkon Tjelmeland and Haakon Austad
Haakon.Tjelmeland@stat.ntnu.no
Department of Mathematical Sciences, Norwegian University of Science and Technology
An approximation for binary Markov random fields – p.1/53
Introduction
Binary (hidden) Markov random field
(
)
X
1
π(x|θ) =
exp −
VC (xC |θ)
b(θ)
C∈C
ex: Ising model (with external field)
Likelihood evaluation not possible (MLE via MCMCMLE)
Direct simulation not possible (simulation possible by MCMC)
Our goals:
define approximate normalising constant
define approximate model from which direct simulation is possible
Starting point: forward-backward recursion for MRF
An approximation for binary Markov random fields – p.2/53
Plan
Notation
Exact forward-backward recursion
Approximate forward-backward recursion
Evaluation criteria for approximation
compare to exact results (for small lattices)
compare results for different approximation levels
use approximation as proposal in independent proposal
Metropolis–Hastings algorithm
Simulation examples.
An approximation for binary Markov random fields – p.3/53
Notation
Binary Markov random field on nI × nJ lattice, N = nI · nJ
State vector x = (x1 , . . . , xN ), with xi ∈ {0, 1}
Set of cliques: C
1
2
3
4
5
6
7
8
9
10
11
12
13
N−1
N
Joint distribution
(
X
a(x|θ)
∝ a(x|θ) = exp −
VC (xC , θ)
π(x|θ) =
b(θ)
C∈C
)
=
Y
e−VC (xC ,θ)
C∈C
Reformulation
a(x|θ) =
N
Y
ak (xk:k+p+1 , θ)
k=1
p is a function of nJ and the clique size
for first-order pairwise interaction model: p = nJ
An approximation for binary Markov random fields – p.4/53
Exact forward recursion
Following Pettitt and Reeves (2004) and Friel and Rue (2007)
For illustration: Small 6 × 5 lattice, Ising model
π(x1:30 |θ) = b(θ)−1 a1 (x1:6 , θ)a2 (x2:7 , θ)a3 (x3:8 , θ) · · ·
An approximation for binary Markov random fields – p.5/53
Exact forward recursion
Following Pettitt and Reeves (2004) and Friel and Rue (2007)
For illustration: Small 6 × 5 lattice, Ising model
π(x1:30 |θ) = b(θ)−1 a1 (x1:6 , θ)a2 (x2:7 , θ)a3 (x3:8 , θ) · · ·
#
"
X
−1
a1 (x1:6 , θ) a2 (x2:7 , θ)a3 (x3:8 , θ) · · ·
π(x2:30 |θ) = b(θ)
x1
An approximation for binary Markov random fields – p.6/53
Exact forward recursion
Following Pettitt and Reeves (2004) and Friel and Rue (2007)
For illustration: Small 6 × 5 lattice, Ising model
π(x1:30 |θ) = b(θ)−1 a1 (x1:6 , θ)a2 (x2:7 , θ)a3 (x3:8 , θ) · · ·
#
"
X
−1
a1 (x1:6 , θ) a2 (x2:7 , θ)a3 (x3:8 , θ) · · ·
π(x2:30 |θ) = b(θ)
x1
= b(θ)−1 b2 (x2:6 , θ)a2 (x2:7 , θ)a3 (x3:8 , θ) · · ·
An approximation for binary Markov random fields – p.7/53
Exact forward recursion
Following Pettitt and Reeves (2004) and Friel and Rue (2007)
For illustration: Small 6 × 5 lattice, Ising model
π(x1:30 |θ) = b(θ)−1 a1 (x1:6 , θ)a2 (x2:7 , θ)a3 (x3:8 , θ) · · ·
#
"
X
−1
a1 (x1:6 , θ) a2 (x2:7 , θ)a3 (x3:8 , θ) · · ·
π(x2:30 |θ) = b(θ)
x1
= b(θ)−1 b2 (x2:6 , θ)a2 (x2:7 , θ)a3 (x3:8 , θ) · · ·
π(x3:30 |θ) = b(θ)−1
"
X
x2
#
b2 (x2:6 , θ)a2 (x2:7 , θ) a3 (x3:8 , θ) · · ·
An approximation for binary Markov random fields – p.8/53
Exact forward recursion
Following Pettitt and Reeves (2004) and Friel and Rue (2007)
For illustration: Small 6 × 5 lattice, Ising model
π(x1:30 |θ) = b(θ)−1 a1 (x1:6 , θ)a2 (x2:7 , θ)a3 (x3:8 , θ) · · ·
#
"
X
−1
a1 (x1:6 , θ) a2 (x2:7 , θ)a3 (x3:8 , θ) · · ·
π(x2:30 |θ) = b(θ)
x1
= b(θ)−1 b2 (x2:6 , θ)a2 (x2:7 , θ)a3 (x3:8 , θ) · · ·
π(x3:30 |θ) = b(θ)−1
"
X
x2
#
b2 (x2:6 , θ)a2 (x2:7 , θ) a3 (x3:8 , θ) · · ·
π(x3:30 |θ) = b(θ)−1 b3 (x3:6 , θ)a3 (x3:8 , θ) · · ·
An approximation for binary Markov random fields – p.9/53
Exact forward recursion
Following Pettitt and Reeves (2004) and Friel and Rue (2007)
For illustration: Small 6 × 5 lattice, Ising model
π(x1:30 |θ) = b(θ)−1 a1 (x1:6 , θ)a2 (x2:7 , θ)a3 (x3:8 , θ) · · ·
#
"
X
−1
a1 (x1:6 , θ) a2 (x2:7 , θ)a3 (x3:8 , θ) · · ·
π(x2:30 |θ) = b(θ)
x1
= b(θ)−1 b2 (x2:6 , θ)a2 (x2:7 , θ)a3 (x3:8 , θ) · · ·
π(x3:30 |θ) = b(θ)−1
"
X
x2
#
b2 (x2:6 , θ)a2 (x2:7 , θ) a3 (x3:8 , θ) · · ·
π(x3:30 |θ) = b(θ)−1 b3 (x3:6 , θ)a3 (x3:8 , θ) · · ·
..
.
π(x30 |θ) = b(θ)−1 b30 (x30 , θ)a30 (x30 , θ)
An approximation for binary Markov random fields – p.10/53
Exact backward recursion
Following Pettitt and Reeves (2004) and Friel and Rue (2007)
For illustration: Small 6 × 5 lattice, Ising model
π(x30 |θ) = b(θ)−1 b30 (x30 , θ)a30 (x30 , θ) ∝ b30 (x30 , θ)a30 (x30 , θ)
An approximation for binary Markov random fields – p.11/53
Exact backward recursion
Following Pettitt and Reeves (2004) and Friel and Rue (2007)
For illustration: Small 6 × 5 lattice, Ising model
π(x30 |θ) = b(θ)−1 b30 (x30 , θ)a30 (x30 , θ) ∝ b30 (x30 , θ)a30 (x30 , θ)
π(x29 |x30 , θ) ∝ π(x29:30 |θ) = b29 (x29:30 , θ)a29 (x29:30 , θ)a30 (x30 , θ)
∝ b29 (x29:30 , θ)a29 (x29:30 , θ)
An approximation for binary Markov random fields – p.12/53
Exact backward recursion
Following Pettitt and Reeves (2004) and Friel and Rue (2007)
For illustration: Small 6 × 5 lattice, Ising model
π(x30 |θ) = b(θ)−1 b30 (x30 , θ)a30 (x30 , θ) ∝ b30 (x30 , θ)a30 (x30 , θ)
π(x29 |x30 , θ) ∝ π(x29:30 |θ) = b29 (x29:30 , θ)a29 (x29:30 , θ)a30 (x30 , θ)
∝ b29 (x29:30 , θ)a29 (x29:30 , θ)
π(x28 |x29:30 , θ) ∝ b28 (x28:30 , θ)a28 (x28:30 , θ)
An approximation for binary Markov random fields – p.13/53
Exact backward recursion
Following Pettitt and Reeves (2004) and Friel and Rue (2007)
For illustration: Small 6 × 5 lattice, Ising model
π(x30 |θ) = b(θ)−1 b30 (x30 , θ)a30 (x30 , θ) ∝ b30 (x30 , θ)a30 (x30 , θ)
π(x29 |x30 , θ) ∝ π(x29:30 |θ) = b29 (x29:30 , θ)a29 (x29:30 , θ)a30 (x30 , θ)
∝ b29 (x29:30 , θ)a29 (x29:30 , θ)
π(x28 |x29:30 , θ) ∝ b28 (x28:30 , θ)a28 (x28:30 , θ)
..
.
π(x2 |x2:30 , θ) ∝ b2 (x2:6 , θ)a2 (x2:7 , θ)
π(x1 |x2:30 , θ) ∝ b1 (x1:5 , θ)a1 (x1:6 , θ)
An approximation for binary Markov random fields – p.14/53
Exact backward recursion
Following Pettitt and Reeves (2004) and Friel and Rue (2007)
For illustration: Small 6 × 5 lattice, Ising model
π(x30 |θ) = b(θ)−1 b30 (x30 , θ)a30 (x30 , θ) ∝ b30 (x30 , θ)a30 (x30 , θ)
π(x29 |x30 , θ) ∝ π(x29:30 |θ) = b29 (x29:30 , θ)a29 (x29:30 , θ)a30 (x30 , θ)
∝ b29 (x29:30 , θ)a29 (x29:30 , θ)
π(x28 |x29:30 , θ) ∝ b28 (x28:30 , θ)a28 (x28:30 , θ)
..
.
π(x2 |x2:30 , θ) ∝ b2 (x2:6 , θ)a2 (x2:7 , θ)
π(x1 |x2:30 , θ) ∝ b1 (x1:5 , θ)a1 (x1:6 , θ)
Computational complexity: forward: O(N 2p ), backward: cheap
An approximation for binary Markov random fields – p.15/53
Approximate forward recursion
For illustration: Small 6 × 5 lattice, Ising model
π(x1:30 |θ) = b(θ)−1 a1 (x1:6 , θ)a2 (x2:7 , θ)a3 (x3:8 , θ) · · ·
#
"
X
−1
a1 (x1:6 , θ) a2 (x2:7 , θ)a3 (x3:8 , θ) · · ·
π(x2:30 |θ) = b(θ)
x1
= b(θ)−1 b2 (x2:6 , θ)a2 (x2:7 , θ)a3 (x3:8 , θ) · · ·
π(x3:30 |θ) = b(θ)−1
"
X
x2
#
b2 (x2:6 , θ)a2 (x2:7 , θ) a3 (x3:8 , θ) · · ·
π(x3:30 |θ) = b(θ)−1 b3 (x3:6 , θ)a3 (x3:8 , θ) · · ·
..
.
π(x30 |θ) = b(θ)−1 b30 (x30 , θ)a30 (x30 , θ)
An approximation for binary Markov random fields – p.16/53
Approximate forward recursion
For illustration: Small 6 × 5 lattice, Ising model
π(x1:30 |θ) = b(θ)−1 a1 (x1:6 , θ)a2 (x2:7 , θ)a3 (x3:8 , θ) · · ·
#
"
X
−1
a1 (x1:6 , θ) a2 (x2:7 , θ)a3 (x3:8 , θ) · · ·
π(x2:30 |θ) = b(θ)
x1
≈ eb(θ)−1eb2 (x2:6 , θ)a2 (x2:7 , θ)a3 (x3:8 , θ) · · ·
π(x3:30 |θ) = b(θ)−1
"
X
x2
#
b2 (x2:6 , θ)a2 (x2:7 , θ) a3 (x3:8 , θ) · · ·
π(x3:30 |θ) = b(θ)−1 b3 (x3:6 , θ)a3 (x3:8 , θ) · · ·
..
.
π(x30 |θ) = b(θ)−1 b30 (x30 , θ)a30 (x30 , θ)
An approximation for binary Markov random fields – p.17/53
Approximate forward recursion
For illustration: Small 6 × 5 lattice, Ising model
π(x1:30 |θ) = b(θ)−1 a1 (x1:6 , θ)a2 (x2:7 , θ)a3 (x3:8 , θ) · · ·
#
"
X
−1
a1 (x1:6 , θ) a2 (x2:7 , θ)a3 (x3:8 , θ) · · ·
π(x2:30 |θ) = b(θ)
x1
≈ eb(θ)−1eb2 (x2:6 , θ)a2 (x2:7 , θ)a3 (x3:8 , θ) · · ·
π(x3:30 |θ) ≈ eb(θ)−1
"
X
x2
#
eb2 (x2:6 , θ)a2 (x2:7 , θ) a3 (x3:8 , θ) · · ·
π(x3:30 |θ) = b(θ)−1 b3 (x3:6 , θ)a3 (x3:8 , θ) · · ·
..
.
π(x30 |θ) = b(θ)−1 b30 (x30 , θ)a30 (x30 , θ)
An approximation for binary Markov random fields – p.18/53
Approximate forward recursion
For illustration: Small 6 × 5 lattice, Ising model
π(x1:30 |θ) = b(θ)−1 a1 (x1:6 , θ)a2 (x2:7 , θ)a3 (x3:8 , θ) · · ·
#
"
X
−1
a1 (x1:6 , θ) a2 (x2:7 , θ)a3 (x3:8 , θ) · · ·
π(x2:30 |θ) = b(θ)
x1
≈ eb(θ)−1eb2 (x2:6 , θ)a2 (x2:7 , θ)a3 (x3:8 , θ) · · ·
π(x3:30 |θ) ≈ eb(θ)−1
"
X
x2
#
eb2 (x2:6 , θ)a2 (x2:7 , θ) a3 (x3:8 , θ) · · ·
π(x3:30 |θ) ≈ eb(θ)−1eb3 (x3:6 , θ)a3 (x3:8 , θ) · · ·
..
.
π(x30 |θ) = b(θ)−1 b30 (x30 , θ)a30 (x30 , θ)
An approximation for binary Markov random fields – p.19/53
Approximate forward recursion
For illustration: Small 6 × 5 lattice, Ising model
π(x1:30 |θ) = b(θ)−1 a1 (x1:6 , θ)a2 (x2:7 , θ)a3 (x3:8 , θ) · · ·
#
"
X
−1
a1 (x1:6 , θ) a2 (x2:7 , θ)a3 (x3:8 , θ) · · ·
π(x2:30 |θ) = b(θ)
x1
≈ eb(θ)−1eb2 (x2:6 , θ)a2 (x2:7 , θ)a3 (x3:8 , θ) · · ·
π(x3:30 |θ) ≈ eb(θ)−1
"
X
x2
#
eb2 (x2:6 , θ)a2 (x2:7 , θ) a3 (x3:8 , θ) · · ·
π(x3:30 |θ) ≈ eb(θ)−1eb3 (x3:6 , θ)a3 (x3:8 , θ) · · ·
..
.
π(x30 |θ) ≈ eb(θ)−1eb30 (x30 , θ)a30 (x30 , θ)
An approximation for binary Markov random fields – p.20/53
Approximate backward recursion
For illustration: Small 6 × 5 lattice, Ising model
π(x30 |θ) ∝ eb30 (x30 , θ)a30 (x30 , θ)
π(x29 |x30 , θ) ∝ eb29 (x29:30 , θ)a29 (x29:30 , θ)
π(x28 |x29:30 , θ) ∝ eb28 (x28:30 , θ)a28 (x28:30 , θ)
..
.
π(x2 |x2:30 , θ) ∝ eb2 (x2:6 , θ)a2 (x2:7 , θ)
π(x1 |x2:30 , θ) ∝ eb1 (x1:5 , θ)a1 (x1:6 , θ)
An approximation for binary Markov random fields – p.21/53
Representation of bk (xk:k+p , θ)
Exact recursive formula
bk+1 (xk+1:k+p+1 , θ) =
X
bk (xk:k+p , θ)ak (xk:k+p+1 , θ)
xk
Number of values to store for each k: 2p
Represent bk (xk:k+p , θ) as
ln {bk (xk:k+p , θ)} = βk∅ +
k+p
X
{i}
βk xi +
i=k
i=k
+
k+p−2
X k+p−1
X
i=k
k+p
X
{i,j,t}
k+p−1
X k+p
X
xi xj xt + . . . + βk
=
X
xi xj
j=i+1
{k,...,k+p}
βk
{i,j}
βk
xk · . . . · xk+p
j=i+1 t=j+1
Λ⊆{k,...,k+p}
βkΛ
Y
xi
i∈Λ
An approximation for binary Markov random fields – p.22/53
Ising example
Ising model — small 20 × 20 lattice, i.e. p = 20
red: β = 0.6
black: β = 0.8
3. and 4.
5. and 6.
50
100
150
200
−0.005
0
2000
4000
6000
−0.015
0
−0.04
−0.5
0.00
0.0
0.04
0.5
0.005
1. and 2.
0
20000
40000
An approximation for binary Markov random fields – p.23/53
Ising example
Ising model — small 20 × 20 lattice, i.e. p = 20
red: β = 0.6
black: β = 0.8
3. and 4.
5. and 6.
50
100
150
200
−0.005
0
2000
4000
6000
−0.015
0
−0.04
−0.5
0.00
0.0
0.04
0.5
0.005
1. and 2.
0
20000
40000
β = 0.8: fraction of interactions larger than ε
ε
10−1
10−2
10−3
10−4
10−5
fraction
0.000039
0.000169
0.000906
0.00556
0.0314
An approximation for binary Markov random fields – p.24/53
Forward recursion for new representation
Correspondingly we represent
X
ln {ak (xk:k+p+1 , θ)} =
αkΛ
Y
xi
i∈Λ
Λ⊆{k,...,k+p+1}
Old recursion formula
bk+1 (xk+1:k+p+1 , θ) =
X
bk (xk:k+p , θ)ak (xk:k+p+1 , θ)
xk
Recursion formula for new representation



X
Y 
Λ
exp
βk+1
xi


i∈Λ
Λ⊆{k+1,...,k+p+1}


X
X
Y
Λ
exp
βk
=
xi +

x
k
Λ⊆{k,...,k+p}
i∈Λ
X
Λ⊆{k,...,k+p+1}
αkΛ
Y
i∈Λ
xi



An approximation for binary Markov random fields – p.25/53
Λ
Recursive computation of βk+1
Setting xk+1 = . . . = xk+p+1 = 0 gives
n
∅
exp βk+1
o
o
n
o
n
{k}
{k}
= exp βk∅ + αk∅ + exp βk∅ + βk + αk∅ + αk
An approximation for binary Markov random fields – p.26/53
Λ
Recursive computation of βk+1
Setting xk+1 = . . . = xk+p+1 = 0 gives
n
∅
exp βk+1
o
o
n
o
n
{k}
{k}
= exp βk∅ + αk∅ + exp βk∅ + βk + αk∅ + αk
Setting xi = 1 and xj = 0 for all j 6= i gives
exp
n
∅
βk+1
+
{i}
βk+1
o
o
n
{i}
{i}
∅
∅
= exp βk + βk + αk + αk
n
{i}
+ exp βk∅ + βk
{k}
+ βk
{k,i}
+ βk
{i}
{k}
+ αk∅ + αk + αk
{k,i}
+ αk
An approximation for binary Markov random fields – p.27/53
Λ
Recursive computation of βk+1
Setting xk+1 = . . . = xk+p+1 = 0 gives
n
∅
exp βk+1
o
o
n
o
n
{k}
{k}
= exp βk∅ + αk∅ + exp βk∅ + βk + αk∅ + αk
Setting xi = 1 and xj = 0 for all j 6= i gives
exp
n
∅
βk+1
+
{i}
βk+1
o
o
n
{i}
{i}
∅
∅
= exp βk + βk + αk + αk
n
{i}
+ exp βk∅ + βk
{k}
+ βk
{k,i}
+ βk
{i}
{k}
+ αk∅ + αk + αk
{k,i}
+ αk
Setting xi = xj = 1 and xt = 0 for t 6∈ {i, j} gives
n
∅
exp βk+1
+
{i}
βk+1
+
{j}
βk+1
+
{i,j}
βk+1
o
= ...
An approximation for binary Markov random fields – p.28/53
Recursive scheme
ln {bk (xk:k+p , θ)} =
X
Λ⊆{k,...,k+p}
βkΛ
Y
xi
i∈Λ
0123
Q
A Q
A QQ
Q A
AU
s
Q
+
012
013
023
123
HH
H
H
H
H
HH
H
@
H
H
H
HH
HH@
HH
? ? HH ? H@
R
@
HH
H
j
H
j
H
j
H
13
23
03
12
01
02
HH HH HH @ H
H
H
HH
H
@ HH
H
HH
HH
HH
@ ?
?
?
R H
@
H
H
j
H
j
H
j
H
0
1
2
3
Q
Q
A
Q
Q A
Q A
sAU Q
+
∅
An approximation for binary Markov random fields – p.29/53
Approximation strategy
If a computed βkΛ has |βkΛ | ≤ ε, approximate βkΛ to zero
If for some Λ, βkλ is (approximated to) zero for all λ ⊂ Λ, |λ| = |Λ| − 1,
approximate βkΛ to zero (without computing the exact value)
0123
Q
A Q
A QQ
Q A
AU
+
s
Q
012
013
023
123
HH
H
H
H
H
HH
H
@
H
H
H
HH
HH@
HH
? ? HH ? H@
R
@
HH
H
j
H
j
H
j
H
01
02
13
23
03
12
HH HH HH @ H
HH
HH H
@
HH
HH HH @ H ? H
?
R ? HH
@
H
j
H
j
H
H
j
H
0
1
2
3
Q
Q
A
Q
Q A
Q A
sAU Q
+
∅
An approximation for binary Markov random fields – p.30/53
Approximation strategy
If a computed βkΛ has |βkΛ | ≤ ε, approximate βkΛ to zero
If for some Λ, βkλ is (approximated to) zero for all λ ⊂ Λ, |λ| = |Λ| − 1,
approximate βkΛ to zero (without computing the exact value)
0123
Q
A Q
A QQ
Q A
AU
+
s
Q
012
013
023
123
H
HH
H
HH
H
H
H
@
H
H
H
HH@
HH
HH
? ? HH ? H@
HH
R
@
H
j
H
j
H
j
H
02
03
12
13
23
01
HH HH HH @ H
HH
HH H
@
HH HH HH
@ H ? H
?
R ? HH
@
H
j
H
H
j
H
j
H
0
1
2
3
Q
Q
A
Q
Q A
Q A
sAU Q
+
∅
An approximation for binary Markov random fields – p.31/53
Evaluation criteria for approximation
Compare approximation with exact result — for small lattices
Compare results for different cut off values ε
Use approximation as proposal in an independent proposal
Metropolis–Hastings algorithm — look at acceptance rate
An approximation for binary Markov random fields – p.32/53
Comparison to exact results in a small lattice
Ising model, small 20 × 20 lattice
Simulate first a realisation from the Ising model
Compute the likelihood function l(β)for this realisation
Results for ε = 0, 10−5 , 10−4 , 10−3 , 10−2 and 10−1
β = 0.8
β = 0.9
230
200
160
150
200
250
240
250
270
280
β = 0.6
0.0
0.2
0.4
0.6
0.8
0.0
0.2
0.4
0.6
0.8
0.0
0.2
0.4
0.6
0.8
An approximation for binary Markov random fields – p.33/53
Comparison to exact results in a small lattice
Ising model, small 20 × 20 lattice
Simulate first a realisation from the Ising model
Compute the likelihood function l(β)for this realisation
Results for ε = 0, 10−5 , 10−4 , 10−3 , 10−2 and 10−1
β = 0.8
β = 0.9
230
200
160
150
200
250
240
250
270
280
β = 0.6
0.0
0.2
0.4
0.6
0.8
0.0
0.2
0.4
0.6
0.8
0.0
0.2
0.4
0.6
0.8
An approximation for binary Markov random fields – p.34/53
Comparison to exact results in a small lattice
Ising model, small 20 × 20 lattice
Simulate first a realisation from the Ising model
Compute the likelihood function l(β)for this realisation
Results for ε = 0, 10−5 , 10−4 , 10−3 , 10−2 and 10−1
β = 0.8
β = 0.9
230
200
160
150
200
250
240
250
270
280
β = 0.6
0.0
0.2
0.4
0.6
0.8
0.0
0.2
0.4
0.6
0.8
0.0
0.2
0.4
0.6
0.8
An approximation for binary Markov random fields – p.35/53
Comparison to exact results in a small lattice
Ising model, small 20 × 20 lattice
Simulate first a realisation from the Ising model
Compute the likelihood function l(β)for this realisation
Results for ε = 0, 10−5 , 10−4 , 10−3 , 10−2 and 10−1
β = 0.8
β = 0.9
230
200
160
150
200
250
240
250
270
280
β = 0.6
0.0
0.2
0.4
0.6
0.8
0.0
0.2
0.4
0.6
0.8
0.0
0.2
0.4
0.6
0.8
An approximation for binary Markov random fields – p.36/53
Comparison to exact results in a small lattice
Ising model, small 20 × 20 lattice
Simulate first a realisation from the Ising model
Compute the likelihood function l(β)for this realisation
Results for ε = 0, 10−5 , 10−4 , 10−3 , 10−2 and 10−1
β = 0.8
β = 0.9
230
200
160
150
200
250
240
250
270
280
β = 0.6
0.0
0.2
0.4
0.6
0.8
0.0
0.2
0.4
0.6
0.8
0.0
0.2
0.4
0.6
0.8
An approximation for binary Markov random fields – p.37/53
Comparison to exact results in a small lattice
Ising model, small 20 × 20 lattice
Simulate first a realisation from the Ising model
Compute the likelihood function l(β)for this realisation
Results for ε = 0, 10−5 , 10−4 , 10−3 , 10−2 and 10−1
β = 0.8
β = 0.9
230
200
160
150
200
250
240
250
270
280
β = 0.6
0.0
0.2
0.4
0.6
0.8
0.0
0.2
0.4
0.6
0.8
0.0
0.2
0.4
0.6
0.8
An approximation for binary Markov random fields – p.38/53
Compare results for different cut off value ε
Ising model, 50 × 50 lattice
Simulate first a realisation from the Ising model
Compute the likelihood function l(β) for this realisation
Results for ε = 10−5 , 10−4 , 10−3 , 10−2 and 10−1
β = 0.8
1450
1100
1300
1550
1500
1650
1700
β = 0.6
0.0
0.2
0.4
0.6
0.8
0.0
0.2
0.4
0.6
0.8
An approximation for binary Markov random fields – p.39/53
Compare results for different cut off value ε
Ising model, 50 × 50 lattice
Simulate first a realisation from the Ising model
Compute the likelihood function l(β) for this realisation
Results for ε = 10−5 , 10−4 , 10−3 , 10−2 and 10−1
β = 0.8
1450
1100
1300
1550
1500
1650
1700
β = 0.6
0.0
0.2
0.4
0.6
0.8
0.0
0.2
0.4
0.6
0.8
An approximation for binary Markov random fields – p.40/53
Compare results for different cut off value ε
Ising model, 50 × 50 lattice
Simulate first a realisation from the Ising model
Compute the likelihood function l(β) for this realisation
Results for ε = 10−5 , 10−4 , 10−3 , 10−2 and 10−1
β = 0.8
1450
1100
1300
1550
1500
1650
1700
β = 0.6
0.0
0.2
0.4
0.6
0.8
0.0
0.2
0.4
0.6
0.8
An approximation for binary Markov random fields – p.41/53
Compare results for different cut off value ε
Ising model, 50 × 50 lattice
Simulate first a realisation from the Ising model
Compute the likelihood function l(β) for this realisation
Results for ε = 10−5 , 10−4 , 10−3 , 10−2 and 10−1
β = 0.8
1450
1100
1300
1550
1500
1650
1700
β = 0.6
0.0
0.2
0.4
0.6
0.8
0.0
0.2
0.4
0.6
0.8
An approximation for binary Markov random fields – p.42/53
Compare results for different cut off value ε
Ising model, 50 × 50 lattice
Simulate first a realisation from the Ising model
Compute the likelihood function l(β) for this realisation
Results for ε = 10−5 , 10−4 , 10−3 , 10−2 and 10−1
β = 0.8
1450
1100
1300
1550
1500
1650
1700
β = 0.6
0.0
0.2
0.4
0.6
0.8
0.0
0.2
0.4
0.6
0.8
An approximation for binary Markov random fields – p.43/53
Compare results for different cut off value ε
Ising model, 50 × 50 lattice
Simulate first a realisation from the Ising model
Compute the likelihood function l(β) for this realisation
Results for ε = 10−5 , 10−4 , 10−3 , 10−2 and 10−1
β = 0.8
1450
1100
1300
1550
1500
1650
1700
β = 0.6
0.0
0.2
0.4
0.6
0.8
0.0
0.2
0.4
0.6
0.8
Fraction of interactions computed for ε = 10−3
β
0.1
0.3
0.5
0.7
0.9
fraction
2.1 · 10−13
5.0 · 10−12
7.0 · 10−12
3.3 · 10−11
1.5 · 10−10
An approximation for binary Markov random fields – p.44/53
Used as proposal in a Metropolis–Hastings algorithm
Ising model, 50 × 50 lattice
Initiate Metropolis–Hastings algorithm with exact sample
Run for ε = 10−1 , 10−2 , 10−3 , 10−4 and 10−5
0.0
0.2
0.4
0.6
0.8
1.0
Monitor the Metropolis–Hastings acceptance rate
0.0
0.2
0.4
0.6
0.8
An approximation for binary Markov random fields – p.45/53
Image analysis example
Ising prior, 50 × 50 lattice
Conditionally independent Gaussian observations, yi |xi ∼ N(xi , σ 2 )
Simulated data (true parameter values β = 0.8, σ = 0.5)
Compute marginal likelihood function
l(θ) = π(y|θ) =
π(x|θ)π(y|x, θ)
π(x|y, θ)
An approximation for binary Markov random fields – p.46/53
Image analysis example (cont.)
ε = 10−2
ε = 10−3
ratio
5000
0.8
5000
0.8
4500
0.8
1.006
1.004
4500
0.6
4000
0.6
4000
0.6
0.4
3500
0.4
3500
0.4
3000
0.2
0.2
0.4
0.6
0.8
1.0
1.000
3000
0.2
2500
0.0
0.2
1.002
0.998
2500
0.0
0.2
0.4
0.6
0.8
1.0
0.0
0.2
0.4
0.6
0.8
1.0
An approximation for binary Markov random fields – p.47/53
Image analysis example (cont.)
0.90
ε = 10−3
2400
0.85
2380
2360
0.80
2340
0.75
0.70
0.40
2320
2300
0.45
0.50
0.55
0.60
An approximation for binary Markov random fields – p.48/53
Example with 3 × 3 clique
3 × 3 clique model, pairwise interaction only, 100 × 100 lattice
Realisations from specified model, by MCMC
0.0
0.2
0.4
0.6
0.8
1.0
1.0
0.0
0.2
0.4
0.6
0.8
1.0
0.8
0.6
0.4
0.2
0.0
0.0
0.2
0.4
0.6
0.8
1.0
Realisations from approximate model, ε = 10−3
0.0
0.2
0.4
0.6
0.8
1.0
0.0
0.2
0.4
0.6
0.8
1.0
An approximation for binary Markov random fields – p.49/53
Problematic example
4 × 4 clique, strong higher order interactions
Realisations from the model, by MCMC
Too few interactions are approximated to zero — not able to run the
approximation
An approximation for binary Markov random fields – p.50/53
A closer look at the approximate model
Approximate model is
π
e(x1:n |θ) = π
e(xn |θ)e
π (xn−1 |xn , θ)e
π (xn−2 |xn−1:n , θ) · . . . · π
e(x1 |x2:n , θ)
Conditionally independence because:
original MRF
approximation
An approximation for binary Markov random fields – p.51/53
A closer look at the approximate model (cont.)
ε = 10−2
ε = 10−4
β = 0.4
β = 0.8
An approximation for binary Markov random fields – p.52/53
Closing remarks
For MRFs we have defined approximation to
the normalising constant — that (often) can be computed
the joint distribution — that (often) can be simulated directly
The approximation is based on
representation of bk (xk:k+p , θ) by interaction parameters
most interaction parameters must be small
have assumed higher order interactions to be small whenever
lower order interactions are small
We have demonstrated the quality of the approximation in a number
of examples
The approximative model is a Markov mesh model (and POMM)
Can sum out the variables in a different order
An approximation for binary Markov random fields – p.53/53
Download