stat 375: inference in graphical models lectures...

78

Upload: others

Post on 09-Feb-2020

10 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: Stat 375: Inference in Graphical Models Lectures 3-4montanar/TEACHING/Stat375/LECTURES/lect-3-4.pdf · Stat 375: Inference in Graphical Models Lectures 3-4 Andrea Montanari Stanford

Stat 375: Inference in Graphical Models

Lectures 3-4

Andrea Montanari

Stanford University

March 31, 2012

Andrea Montanari (Stanford) Stat375: Lecture 3, 4 March 31, 2012 1 / 44

Page 2: Stat 375: Inference in Graphical Models Lectures 3-4montanar/TEACHING/Stat375/LECTURES/lect-3-4.pdf · Stat 375: Inference in Graphical Models Lectures 3-4 Andrea Montanari Stanford

Undirected Pairwise Graphical Model

x1

x2 x3 x4

x5x6

x7x8x9x10

x11x12

G = (V ;E), V = [n ], x = (x1; : : : ; xn), xi 2 X , jX j <1 (small)

�(x ) =1

Z

Y(ij )2E

ij (xi ; xj ) :

� ( ij )(i ;j )2EAndrea Montanari (Stanford) Stat375: Lecture 3, 4 March 31, 2012 2 / 44

Page 3: Stat 375: Inference in Graphical Models Lectures 3-4montanar/TEACHING/Stat375/LECTURES/lect-3-4.pdf · Stat 375: Inference in Graphical Models Lectures 3-4 Andrea Montanari Stanford

Probabilistic inference tasks

Given (G ; )

I Compute the partition function ZG(�)

I Compute expectations E�ff (xi )g

I Sample from �G; ( � )

The above are roughly equivalent.

Andrea Montanari (Stanford) Stat375: Lecture 3, 4 March 31, 2012 3 / 44

Page 4: Stat 375: Inference in Graphical Models Lectures 3-4montanar/TEACHING/Stat375/LECTURES/lect-3-4.pdf · Stat 375: Inference in Graphical Models Lectures 3-4 Andrea Montanari Stanford

These two lectures

I Computatonal hardness and reductions.

I Graph structure and hardness: the case of one-dimensional models.

Andrea Montanari (Stanford) Stat375: Lecture 3, 4 March 31, 2012 4 / 44

Page 5: Stat 375: Inference in Graphical Models Lectures 3-4montanar/TEACHING/Stat375/LECTURES/lect-3-4.pdf · Stat 375: Inference in Graphical Models Lectures 3-4 Andrea Montanari Stanford

Computational hardness and reductions

Andrea Montanari (Stanford) Stat375: Lecture 3, 4 March 31, 2012 5 / 44

Page 6: Stat 375: Inference in Graphical Models Lectures 3-4montanar/TEACHING/Stat375/LECTURES/lect-3-4.pdf · Stat 375: Inference in Graphical Models Lectures 3-4 Andrea Montanari Stanford

Formalization: The class #P

S = f0; 1g� ��binary strings

;

js j = length of string s :

Andrea Montanari (Stanford) Stat375: Lecture 3, 4 March 31, 2012 6 / 44

Page 7: Stat 375: Inference in Graphical Models Lectures 3-4montanar/TEACHING/Stat375/LECTURES/lect-3-4.pdf · Stat 375: Inference in Graphical Models Lectures 3-4 Andrea Montanari Stanford

Formalization: The class #P

A p-relation:

R : S� S! f0; 1g ;

I R(s ; x ) = 1 ) jx j � Poly(js j).

I R(s ; x ) = 1 can be checked in polynomial time

Andrea Montanari (Stanford) Stat375: Lecture 3, 4 March 31, 2012 7 / 44

Page 8: Stat 375: Inference in Graphical Models Lectures 3-4montanar/TEACHING/Stat375/LECTURES/lect-3-4.pdf · Stat 375: Inference in Graphical Models Lectures 3-4 Andrea Montanari Stanford

Formalization: The class #P

Decision: Given s is there an x such that R(s ; x ) = 1?

Construction: Given s construct an x such that R(s ; x ) = 1.

Counting: Given s how many x 's are such that R(s ; x ) = 1?

(Class #P)

Sampling: Given s , sample a uniformy random element in

fx : R(s ; x ) = 1g.

Marginals: Need a bit more structure.

Andrea Montanari (Stanford) Stat375: Lecture 3, 4 March 31, 2012 8 / 44

Page 9: Stat 375: Inference in Graphical Models Lectures 3-4montanar/TEACHING/Stat375/LECTURES/lect-3-4.pdf · Stat 375: Inference in Graphical Models Lectures 3-4 Andrea Montanari Stanford

Example: Independent sets

x1

x2 x3 x4

x5x6

x7x8x9x10

x11x12

s = G = (V ;E)x = (xi )i2V , xi 2 X = f0; 1g

RIS(G ; x ) =

(0 if there exists (i ; j ) 2 E with xi = xj = 1

1 otherwise.

Andrea Montanari (Stanford) Stat375: Lecture 3, 4 March 31, 2012 9 / 44

Page 10: Stat 375: Inference in Graphical Models Lectures 3-4montanar/TEACHING/Stat375/LECTURES/lect-3-4.pdf · Stat 375: Inference in Graphical Models Lectures 3-4 Andrea Montanari Stanford

Associated graphical model

�(x ) =1

Z (G)

Y(i ;j )2E

(xi ; xj ) ; (xi ; xj ) =

(0 if xi = xj = 1,

1 otherwise.

Counting is computing a partition function.

Z (G) = jIndependent Sets(G)j

=��� x : RIS(G ; x ) = 1

��

Andrea Montanari (Stanford) Stat375: Lecture 3, 4 March 31, 2012 10 / 44

Page 11: Stat 375: Inference in Graphical Models Lectures 3-4montanar/TEACHING/Stat375/LECTURES/lect-3-4.pdf · Stat 375: Inference in Graphical Models Lectures 3-4 Andrea Montanari Stanford

Associated graphical model

�(x ) =1

Z (G)

Y(i ;j )2E

(xi ; xj ) ; (xi ; xj ) =

(0 if xi = xj = 1,

1 otherwise.

Counting is computing a partition function.

Z (G) = jIndependent Sets(G)j

=��� x : RIS(G ; x ) = 1

��

Andrea Montanari (Stanford) Stat375: Lecture 3, 4 March 31, 2012 10 / 44

Page 12: Stat 375: Inference in Graphical Models Lectures 3-4montanar/TEACHING/Stat375/LECTURES/lect-3-4.pdf · Stat 375: Inference in Graphical Models Lectures 3-4 Andrea Montanari Stanford

Does #P require ij (xi ; xj ) 2 f0; 1g?

Can have ij : X � X ! N:

I Add factor node and auxiliary variable for edge (i ; j ).

Can have ij : X � X ! Q:

I Normalize to make all weights integer.

Andrea Montanari (Stanford) Stat375: Lecture 3, 4 March 31, 2012 11 / 44

Page 13: Stat 375: Inference in Graphical Models Lectures 3-4montanar/TEACHING/Stat375/LECTURES/lect-3-4.pdf · Stat 375: Inference in Graphical Models Lectures 3-4 Andrea Montanari Stanford

Does #P require ij (xi ; xj ) 2 f0; 1g?

Can have ij : X � X ! N:

I Add factor node and auxiliary variable for edge (i ; j ).

Can have ij : X � X ! Q:

I Normalize to make all weights integer.

Andrea Montanari (Stanford) Stat375: Lecture 3, 4 March 31, 2012 11 / 44

Page 14: Stat 375: Inference in Graphical Models Lectures 3-4montanar/TEACHING/Stat375/LECTURES/lect-3-4.pdf · Stat 375: Inference in Graphical Models Lectures 3-4 Andrea Montanari Stanford

Reductions within #P

Counting R1 reduces to counting R2 if you have

I A poly-mapping ' : S! S

I A poly-mapping : N! N, s.t.de�ning

Z1=2(s) ���� x : R1=2(s ; x ) = 1

�� ;we have

Z1(s) = (Z2('(s)))

(Usually one takes (N ) = N .)

Andrea Montanari (Stanford) Stat375: Lecture 3, 4 March 31, 2012 12 / 44

Page 15: Stat 375: Inference in Graphical Models Lectures 3-4montanar/TEACHING/Stat375/LECTURES/lect-3-4.pdf · Stat 375: Inference in Graphical Models Lectures 3-4 Andrea Montanari Stanford

Reductions within #P

Counting R1 reduces to counting R2 if you have

I A poly-mapping ' : S! S

I A poly-mapping : N! N, s.t.de�ning

Z1=2(s) ���� x : R1=2(s ; x ) = 1

�� ;we have

Z1(s) = (Z2('(s)))

(Usually one takes (N ) = N .)

Andrea Montanari (Stanford) Stat375: Lecture 3, 4 March 31, 2012 12 / 44

Page 16: Stat 375: Inference in Graphical Models Lectures 3-4montanar/TEACHING/Stat375/LECTURES/lect-3-4.pdf · Stat 375: Inference in Graphical Models Lectures 3-4 Andrea Montanari Stanford

Bad news

R is #P-complete if any problem in #P can be reduced to it.

Theorem (Valiant 1979)

I Independent sets is #P complete.

I q-coloring (q � 3) is #P complete.

I #-SAT is #P complete.

I Permanent is #P complete.

Andrea Montanari (Stanford) Stat375: Lecture 3, 4 March 31, 2012 13 / 44

Page 17: Stat 375: Inference in Graphical Models Lectures 3-4montanar/TEACHING/Stat375/LECTURES/lect-3-4.pdf · Stat 375: Inference in Graphical Models Lectures 3-4 Andrea Montanari Stanford

Bad news

R is #P-complete if any problem in #P can be reduced to it.

Theorem (Valiant 1979)

I Independent sets is #P complete.

I q-coloring (q � 3) is #P complete.

I #-SAT is #P complete.

I Permanent is #P complete.

Andrea Montanari (Stanford) Stat375: Lecture 3, 4 March 31, 2012 13 / 44

Page 18: Stat 375: Inference in Graphical Models Lectures 3-4montanar/TEACHING/Stat375/LECTURES/lect-3-4.pdf · Stat 375: Inference in Graphical Models Lectures 3-4 Andrea Montanari Stanford

Reductions from other inference problems

Proposition

If R is self-reducible, then sampling and marginals reduce tocounting.

Will not de�ne `self-reducible' formally

Andrea Montanari (Stanford) Stat375: Lecture 3, 4 March 31, 2012 14 / 44

Page 19: Stat 375: Inference in Graphical Models Lectures 3-4montanar/TEACHING/Stat375/LECTURES/lect-3-4.pdf · Stat 375: Inference in Graphical Models Lectures 3-4 Andrea Montanari Stanford

Independent sets: Marginals ! Counting

x1

x2 x3 x4

x5x6

x7x8x9x10

x11x12

�(fxi = 1g) =Z (G ; xi = 1)

Z (G ; xi = 0) + Z (Xi = 1);

Z (G ; xi = �) ���� independent sets of G with xi = �

�� ;Z (G ; xi = 0) = Z (G n fig) ; Z (G ; xi = 1) = Z (G n fig [ @i) :

Andrea Montanari (Stanford) Stat375: Lecture 3, 4 March 31, 2012 15 / 44

Page 20: Stat 375: Inference in Graphical Models Lectures 3-4montanar/TEACHING/Stat375/LECTURES/lect-3-4.pdf · Stat 375: Inference in Graphical Models Lectures 3-4 Andrea Montanari Stanford

Independent sets: Marginals ! Counting

x1

x2 x3 x4

x5x6

x7x8x9x10

x11x12

�(fxi = 1g) =Z (G ; xi = 1)

Z (G ; xi = 0) + Z (Xi = 1);

Z (G ; xi = �) ���� independent sets of G with xi = �

�� ;Z (G ; xi = 0) = Z (G n fig) ; Z (G ; xi = 1) = Z (G n fig [ @i) :

Andrea Montanari (Stanford) Stat375: Lecture 3, 4 March 31, 2012 15 / 44

Page 21: Stat 375: Inference in Graphical Models Lectures 3-4montanar/TEACHING/Stat375/LECTURES/lect-3-4.pdf · Stat 375: Inference in Graphical Models Lectures 3-4 Andrea Montanari Stanford

Independent sets: Marginals ! Counting

x1

x2 x3 x4

x5x6

x7x8x9x10

x11x12

�(fxi = 1g) =Z (G ; xi = 1)

Z (G ; xi = 0) + Z (Xi = 1);

Z (G ; xi = �) ���� independent sets of G with xi = �

�� ;Z (G ; xi = 0) = Z (G n fig) ; Z (G ; xi = 1) = Z (G n fig [ @i) :

Andrea Montanari (Stanford) Stat375: Lecture 3, 4 March 31, 2012 15 / 44

Page 22: Stat 375: Inference in Graphical Models Lectures 3-4montanar/TEACHING/Stat375/LECTURES/lect-3-4.pdf · Stat 375: Inference in Graphical Models Lectures 3-4 Andrea Montanari Stanford

Independent sets: Sampling ! Marginals

Sequential Sampling( graph G)

1: Set G0 = G , ` = 0;

2: While G` is not empty:

3: Choose i 2 V (G`);4: Compute pi = �G`

(fxi = 1g);5: Draw xi �Bernoulli(pi );6: If xi = 1, set G`+1 = G` n fig [ @i , ` `+ 1;

7: If xi = 0, set G`+1 = G` n fig, ` `+ 1;

Exercise

How should the above be modi�ed for q-coloring? What about a

general MRF?

Andrea Montanari (Stanford) Stat375: Lecture 3, 4 March 31, 2012 16 / 44

Page 23: Stat 375: Inference in Graphical Models Lectures 3-4montanar/TEACHING/Stat375/LECTURES/lect-3-4.pdf · Stat 375: Inference in Graphical Models Lectures 3-4 Andrea Montanari Stanford

Independent sets: Sampling ! Marginals

Sequential Sampling( graph G)

1: Set G0 = G , ` = 0;

2: While G` is not empty:

3: Choose i 2 V (G`);4: Compute pi = �G`

(fxi = 1g);5: Draw xi �Bernoulli(pi );6: If xi = 1, set G`+1 = G` n fig [ @i , ` `+ 1;

7: If xi = 0, set G`+1 = G` n fig, ` `+ 1;

Exercise

How should the above be modi�ed for q-coloring? What about a

general MRF?

Andrea Montanari (Stanford) Stat375: Lecture 3, 4 March 31, 2012 16 / 44

Page 24: Stat 375: Inference in Graphical Models Lectures 3-4montanar/TEACHING/Stat375/LECTURES/lect-3-4.pdf · Stat 375: Inference in Graphical Models Lectures 3-4 Andrea Montanari Stanford

Independent sets: Counting ! Marginals

1

Z (G)=

Z (G n f1g)

Z (G)�Z (G n f1; 2g)

Z (G n f1g)� � �

Z (;)

Z (G n f1; : : : ;n � 1g)

= �G(x1 = 0) � �Gnf1g(x2 = 0) � � ��Gnf1;:::;n�1g(xn = 0)

Andrea Montanari (Stanford) Stat375: Lecture 3, 4 March 31, 2012 17 / 44

Page 25: Stat 375: Inference in Graphical Models Lectures 3-4montanar/TEACHING/Stat375/LECTURES/lect-3-4.pdf · Stat 375: Inference in Graphical Models Lectures 3-4 Andrea Montanari Stanford

Independent sets: Counting ! Marginals

1

Z (G)=

Z (G n f1g)

Z (G)�Z (G n f1; 2g)

Z (G n f1g)� � �

Z (;)

Z (G n f1; : : : ;n � 1g)

= �G(x1 = 0) � �Gnf1g(x2 = 0) � � ��Gnf1;:::;n�1g(xn = 0)

Andrea Montanari (Stanford) Stat375: Lecture 3, 4 March 31, 2012 17 / 44

Page 26: Stat 375: Inference in Graphical Models Lectures 3-4montanar/TEACHING/Stat375/LECTURES/lect-3-4.pdf · Stat 375: Inference in Graphical Models Lectures 3-4 Andrea Montanari Stanford

Independent sets: Marginals ! Sampling

Samples: x (1), x (2),. . . x (m) �i :i :d �G

b�G(xi = 1) =1

m

mX`=1

x(`)i

Taking m = Poly(n), can estimate marginals with relative error

1=Poly(n).

Not exact reduction!

Indeed there are problems for which sampling is easy and exact

counting #P hard (e.g. #DNF).

Andrea Montanari (Stanford) Stat375: Lecture 3, 4 March 31, 2012 18 / 44

Page 27: Stat 375: Inference in Graphical Models Lectures 3-4montanar/TEACHING/Stat375/LECTURES/lect-3-4.pdf · Stat 375: Inference in Graphical Models Lectures 3-4 Andrea Montanari Stanford

Independent sets: Marginals ! Sampling

Samples: x (1), x (2),. . . x (m) �i :i :d �G

b�G(xi = 1) =1

m

mX`=1

x(`)i

Taking m = Poly(n), can estimate marginals with relative error

1=Poly(n).

Not exact reduction!

Indeed there are problems for which sampling is easy and exact

counting #P hard (e.g. #DNF).

Andrea Montanari (Stanford) Stat375: Lecture 3, 4 March 31, 2012 18 / 44

Page 28: Stat 375: Inference in Graphical Models Lectures 3-4montanar/TEACHING/Stat375/LECTURES/lect-3-4.pdf · Stat 375: Inference in Graphical Models Lectures 3-4 Andrea Montanari Stanford

Independent sets: Marginals ! Sampling

Samples: x (1), x (2),. . . x (m) �i :i :d �G

b�G(xi = 1) =1

m

mX`=1

x(`)i

Taking m = Poly(n), can estimate marginals with relative error

1=Poly(n).

Not exact reduction!

Indeed there are problems for which sampling is easy and exact

counting #P hard (e.g. #DNF).

Andrea Montanari (Stanford) Stat375: Lecture 3, 4 March 31, 2012 18 / 44

Page 29: Stat 375: Inference in Graphical Models Lectures 3-4montanar/TEACHING/Stat375/LECTURES/lect-3-4.pdf · Stat 375: Inference in Graphical Models Lectures 3-4 Andrea Montanari Stanford

The next best thing

FPTAS (Fully Polynomial Time Approximation Scheme)

Given G ; ", outputs bZ (G ; ") in time Poly(n ; 1=") such that

(1� ")Z (G) � bZ (G ; ") � (1+ ")Z (G) :

FPRAS (Fully Polynomial time Randomized Approximation Scheme)

Given G ; ", outputs bZ (G ; ") in time Poly(n ; 1=") such that

Pf(1� ")Z (G) � bZ (G ; ") � (1+ ")Z (G)g �3

4:

Andrea Montanari (Stanford) Stat375: Lecture 3, 4 March 31, 2012 19 / 44

Page 30: Stat 375: Inference in Graphical Models Lectures 3-4montanar/TEACHING/Stat375/LECTURES/lect-3-4.pdf · Stat 375: Inference in Graphical Models Lectures 3-4 Andrea Montanari Stanford

The next best thing

FPTAS (Fully Polynomial Time Approximation Scheme)

Given G ; ", outputs bZ (G ; ") in time Poly(n ; 1=") such that

(1� ")Z (G) � bZ (G ; ") � (1+ ")Z (G) :

FPRAS (Fully Polynomial time Randomized Approximation Scheme)

Given G ; ", outputs bZ (G ; ") in time Poly(n ; 1=") such that

Pf(1� ")Z (G) � bZ (G ; ") � (1+ ")Z (G)g �3

4:

Andrea Montanari (Stanford) Stat375: Lecture 3, 4 March 31, 2012 19 / 44

Page 31: Stat 375: Inference in Graphical Models Lectures 3-4montanar/TEACHING/Stat375/LECTURES/lect-3-4.pdf · Stat 375: Inference in Graphical Models Lectures 3-4 Andrea Montanari Stanford

Reductions between approximation problems

Counting: Computing partition function within multiplicative error ".

Marginals: Computing marginals within multiplicative error ".

Sampling: Generating x � e�, with ke�� �kTV � ".

These are polynomially equivalent.

Andrea Montanari (Stanford) Stat375: Lecture 3, 4 March 31, 2012 20 / 44

Page 32: Stat 375: Inference in Graphical Models Lectures 3-4montanar/TEACHING/Stat375/LECTURES/lect-3-4.pdf · Stat 375: Inference in Graphical Models Lectures 3-4 Andrea Montanari Stanford

Reductions between approximation problems

Counting: Computing partition function within multiplicative error ".

Marginals: Computing marginals within multiplicative error ".

Sampling: Generating x � e�, with ke�� �kTV � ".

These are polynomially equivalent.

Andrea Montanari (Stanford) Stat375: Lecture 3, 4 March 31, 2012 20 / 44

Page 33: Stat 375: Inference in Graphical Models Lectures 3-4montanar/TEACHING/Stat375/LECTURES/lect-3-4.pdf · Stat 375: Inference in Graphical Models Lectures 3-4 Andrea Montanari Stanford

Bad news and good news

Theorem

No FPRAS exists for f Independent Sets, #SAT, Ising, . . . gunless P=NP.

[e.g. Luby, Vigoda, 1999,. . . ,Sly 2010]

Theorem

FPRAS/FPTAS exist for f Independent Sets at small Degree,

Permanent, Ferromagnetic Ising, . . . g.

[We'll see examples of this type]

Andrea Montanari (Stanford) Stat375: Lecture 3, 4 March 31, 2012 21 / 44

Page 34: Stat 375: Inference in Graphical Models Lectures 3-4montanar/TEACHING/Stat375/LECTURES/lect-3-4.pdf · Stat 375: Inference in Graphical Models Lectures 3-4 Andrea Montanari Stanford

Bad news and good news

Theorem

No FPRAS exists for f Independent Sets, #SAT, Ising, . . . gunless P=NP.

[e.g. Luby, Vigoda, 1999,. . . ,Sly 2010]

Theorem

FPRAS/FPTAS exist for f Independent Sets at small Degree,

Permanent, Ferromagnetic Ising, . . . g.

[We'll see examples of this type]

Andrea Montanari (Stanford) Stat375: Lecture 3, 4 March 31, 2012 21 / 44

Page 35: Stat 375: Inference in Graphical Models Lectures 3-4montanar/TEACHING/Stat375/LECTURES/lect-3-4.pdf · Stat 375: Inference in Graphical Models Lectures 3-4 Andrea Montanari Stanford

How do you prove inapproximability?

x1

x2 x3 x4

x5x6

x7x8x9x10

x11x12

Antiferromagnetic Ising model: x = (x1; : : : ; xn) 2 f+1;�1gV

�(x ) =1

Z (G ; �)exp

n� �

X(i ;j )2E

xixjo

Andrea Montanari (Stanford) Stat375: Lecture 3, 4 March 31, 2012 22 / 44

Page 36: Stat 375: Inference in Graphical Models Lectures 3-4montanar/TEACHING/Stat375/LECTURES/lect-3-4.pdf · Stat 375: Inference in Graphical Models Lectures 3-4 Andrea Montanari Stanford

How do you prove inapproximability?

x1

x2 x3 x4

x5x6

x7x8x9x10

x11x12

Antiferromagnetic Ising model: x = (x1; : : : ; xn) 2 f+1;�1gV

cutG(x ) ���� edges connecting xi = +1 and xj = �1

�� ;�(x ) =

1

Z (G ; �)exp

n2�cutG(x )

oAndrea Montanari (Stanford) Stat375: Lecture 3, 4 March 31, 2012 23 / 44

Page 37: Stat 375: Inference in Graphical Models Lectures 3-4montanar/TEACHING/Stat375/LECTURES/lect-3-4.pdf · Stat 375: Inference in Graphical Models Lectures 3-4 Andrea Montanari Stanford

For � large enough

�(x ) =1

Z (G ; �)exp

n2�cutG(x )

oconcentrates on MAXCUTS

Exercise

If � = n2 then, for all n large enough

P��cutG(x ) = MAXCUT(G)

1

2:

But MAXCUT is NP-complete

Andrea Montanari (Stanford) Stat375: Lecture 3, 4 March 31, 2012 24 / 44

Page 38: Stat 375: Inference in Graphical Models Lectures 3-4montanar/TEACHING/Stat375/LECTURES/lect-3-4.pdf · Stat 375: Inference in Graphical Models Lectures 3-4 Andrea Montanari Stanford

For � large enough

�(x ) =1

Z (G ; �)exp

n2�cutG(x )

oconcentrates on MAXCUTS

Exercise

If � = n2 then, for all n large enough

P��cutG(x ) = MAXCUT(G)

1

2:

But MAXCUT is NP-complete

Andrea Montanari (Stanford) Stat375: Lecture 3, 4 March 31, 2012 24 / 44

Page 39: Stat 375: Inference in Graphical Models Lectures 3-4montanar/TEACHING/Stat375/LECTURES/lect-3-4.pdf · Stat 375: Inference in Graphical Models Lectures 3-4 Andrea Montanari Stanford

For � large enough

�(x ) =1

Z (G ; �)exp

n2�cutG(x )

oconcentrates on MAXCUTS

Exercise

If � = n2 then, for all n large enough

P��cutG(x ) = MAXCUT(G)

1

2:

But MAXCUT is NP-complete

Andrea Montanari (Stanford) Stat375: Lecture 3, 4 March 31, 2012 24 / 44

Page 40: Stat 375: Inference in Graphical Models Lectures 3-4montanar/TEACHING/Stat375/LECTURES/lect-3-4.pdf · Stat 375: Inference in Graphical Models Lectures 3-4 Andrea Montanari Stanford

But you cheated taking � so large!!!

Keep � = 1 and

I Replicate each edge n2 times.

Keep � = 1 and

I Replicate each vertex k times.

I Place a completely connected graph on the k copies.

I Replace each edge by a bipartite completely connected graph on kvertices.

Andrea Montanari (Stanford) Stat375: Lecture 3, 4 March 31, 2012 25 / 44

Page 41: Stat 375: Inference in Graphical Models Lectures 3-4montanar/TEACHING/Stat375/LECTURES/lect-3-4.pdf · Stat 375: Inference in Graphical Models Lectures 3-4 Andrea Montanari Stanford

But you cheated taking � so large!!!

Keep � = 1 and

I Replicate each edge n2 times.

Keep � = 1 and

I Replicate each vertex k times.

I Place a completely connected graph on the k copies.

I Replace each edge by a bipartite completely connected graph on kvertices.

Andrea Montanari (Stanford) Stat375: Lecture 3, 4 March 31, 2012 25 / 44

Page 42: Stat 375: Inference in Graphical Models Lectures 3-4montanar/TEACHING/Stat375/LECTURES/lect-3-4.pdf · Stat 375: Inference in Graphical Models Lectures 3-4 Andrea Montanari Stanford

But you cheated taking � so large!!!

Keep � = 1 and

I Replicate each edge n2 times.

Keep � = 1 and

I Replicate each vertex k times.

I Place a completely connected graph on the k copies.

I Replace each edge by a bipartite completely connected graph on kvertices.

Andrea Montanari (Stanford) Stat375: Lecture 3, 4 March 31, 2012 25 / 44

Page 43: Stat 375: Inference in Graphical Models Lectures 3-4montanar/TEACHING/Stat375/LECTURES/lect-3-4.pdf · Stat 375: Inference in Graphical Models Lectures 3-4 Andrea Montanari Stanford

The case of one-dimensional models

Andrea Montanari (Stanford) Stat375: Lecture 3, 4 March 31, 2012 26 / 44

Page 44: Stat 375: Inference in Graphical Models Lectures 3-4montanar/TEACHING/Stat375/LECTURES/lect-3-4.pdf · Stat 375: Inference in Graphical Models Lectures 3-4 Andrea Montanari Stanford

Line graph

x1 x2 x3 x4 x5 x6 x7

�(x ) =1

Z

n�1Yi=1

i (xi ; xi+1)

Andrea Montanari (Stanford) Stat375: Lecture 3, 4 March 31, 2012 27 / 44

Page 45: Stat 375: Inference in Graphical Models Lectures 3-4montanar/TEACHING/Stat375/LECTURES/lect-3-4.pdf · Stat 375: Inference in Graphical Models Lectures 3-4 Andrea Montanari Stanford

Line graph: Computing marginals

x1 x2 x3 x4 x5 x6 x7

�i!(x1; : : : ; xi ) �1

Zi!

i�1Yj=1

j (xj ; xj+1) ;

�(i+1) (xi+1; : : : ; xn) �1

Z(i+1)

n�1Yj=i+1

j (xj ; xj+1) ;

�i!(xi ) �X

x1;:::;xi�1

�i!(x1; : : : ; xi ) ;

�(i+1) (xi+1) �X

xi+2;:::;xn

�(i+1) (xi+1; : : : ; xn) :

Andrea Montanari (Stanford) Stat375: Lecture 3, 4 March 31, 2012 28 / 44

Page 46: Stat 375: Inference in Graphical Models Lectures 3-4montanar/TEACHING/Stat375/LECTURES/lect-3-4.pdf · Stat 375: Inference in Graphical Models Lectures 3-4 Andrea Montanari Stanford

Line graph: Computing marginals

x1 x2 x3 x4 x5 x6 x7

�i!(x1; : : : ; xi ) �1

Zi!

i�1Yj=1

j (xj ; xj+1) ;

�(i+1) (xi+1; : : : ; xn) �1

Z(i+1)

n�1Yj=i+1

j (xj ; xj+1) ;

�i!(xi ) �X

x1;:::;xi�1

�i!(x1; : : : ; xi ) ;

�(i+1) (xi+1) �X

xi+2;:::;xn

�(i+1) (xi+1; : : : ; xn) :

Andrea Montanari (Stanford) Stat375: Lecture 3, 4 March 31, 2012 28 / 44

Page 47: Stat 375: Inference in Graphical Models Lectures 3-4montanar/TEACHING/Stat375/LECTURES/lect-3-4.pdf · Stat 375: Inference in Graphical Models Lectures 3-4 Andrea Montanari Stanford

Line graph: Computing marginals

x1 x2 x3 x4 x5 x6 x7

�i!(x1; : : : ; xi ) =1eZi! �(i�1)!(x1; : : : ; xi�1) i�1(xi�1; xi ) ;X

x1;:::;xi�1

�i!(x1; : : : ; xi ) =1eZi!

Xx1;:::;xi�1

�(i�1)!(x1; : : : ; xi�1) i�1(xi�1; xi ) ;

�i!(xi ) =1eZi!

Xxi�1

�(i�1)!(xi�1) i�1(xi�1; xi ) ;

Andrea Montanari (Stanford) Stat375: Lecture 3, 4 March 31, 2012 29 / 44

Page 48: Stat 375: Inference in Graphical Models Lectures 3-4montanar/TEACHING/Stat375/LECTURES/lect-3-4.pdf · Stat 375: Inference in Graphical Models Lectures 3-4 Andrea Montanari Stanford

Line graph: Computing marginals

x1 x2 x3 x4 x5 x6 x7

�i!(x1; : : : ; xi ) =1eZi! �(i�1)!(x1; : : : ; xi�1) i�1(xi�1; xi ) ;X

x1;:::;xi�1

�i!(x1; : : : ; xi ) =1eZi!

Xx1;:::;xi�1

�(i�1)!(x1; : : : ; xi�1) i�1(xi�1; xi ) ;

�i!(xi ) =1eZi!

Xxi�1

�(i�1)!(xi�1) i�1(xi�1; xi ) ;

Andrea Montanari (Stanford) Stat375: Lecture 3, 4 March 31, 2012 29 / 44

Page 49: Stat 375: Inference in Graphical Models Lectures 3-4montanar/TEACHING/Stat375/LECTURES/lect-3-4.pdf · Stat 375: Inference in Graphical Models Lectures 3-4 Andrea Montanari Stanford

Line graph: Computing marginals

x1 x2 x3 x4 x5 x6 x7

�i!(x1; : : : ; xi ) =1eZi! �(i�1)!(x1; : : : ; xi�1) i�1(xi�1; xi ) ;X

x1;:::;xi�1

�i!(x1; : : : ; xi ) =1eZi!

Xx1;:::;xi�1

�(i�1)!(x1; : : : ; xi�1) i�1(xi�1; xi ) ;

�i!(xi ) =1eZi!

Xxi�1

�(i�1)!(xi�1) i�1(xi�1; xi ) ;

Andrea Montanari (Stanford) Stat375: Lecture 3, 4 March 31, 2012 29 / 44

Page 50: Stat 375: Inference in Graphical Models Lectures 3-4montanar/TEACHING/Stat375/LECTURES/lect-3-4.pdf · Stat 375: Inference in Graphical Models Lectures 3-4 Andrea Montanari Stanford

Line graph: Computing marginals

x1 x2 x3 x4 x5 x6 x7

�i!(x1; : : : ; xi ) �= �(i�1)!(x1; : : : ; xi�1) i�1(xi�1; xi ) ;

Xx1;:::;xi�1

�i!(x1; : : : ; xi ) �=X

x1;:::;xi�1

�(i�1)!(x1; : : : ; xi�1) i�1(xi�1; xi ) ;

�i!(xi ) �=Xxi�1

�(i�1)!(xi�1) i�1(xi�1; xi ) ;

Andrea Montanari (Stanford) Stat375: Lecture 3, 4 March 31, 2012 30 / 44

Page 51: Stat 375: Inference in Graphical Models Lectures 3-4montanar/TEACHING/Stat375/LECTURES/lect-3-4.pdf · Stat 375: Inference in Graphical Models Lectures 3-4 Andrea Montanari Stanford

Line graph: Computing marginals

xi�1 xi xi+1

�i!(xi ) �=Xxi�1

�(i�1)!(xi�1) i�1(xi�1; xi ) ;

�i (xi ) �=Xxi+1

�(i+1) (xi+1) i (xi ; xi+1) ;

�i (xi ) �=X

xi�1;xi+1

i�1(xi�1; xi ) i (xi ; xi+1) �(i�1)!(xi�1) �(i+1) (xi+1) :

Andrea Montanari (Stanford) Stat375: Lecture 3, 4 March 31, 2012 31 / 44

Page 52: Stat 375: Inference in Graphical Models Lectures 3-4montanar/TEACHING/Stat375/LECTURES/lect-3-4.pdf · Stat 375: Inference in Graphical Models Lectures 3-4 Andrea Montanari Stanford

Line graph: Computing marginals

xi�1 xi xi+1

�i!(xi ) �=Xxi�1

�(i�1)!(xi�1) i�1(xi�1; xi ) ;

�i (xi ) �=Xxi+1

�(i+1) (xi+1) i (xi ; xi+1) ;

�i (xi ) �=X

xi�1;xi+1

i�1(xi�1; xi ) i (xi ; xi+1) �(i�1)!(xi�1) �(i+1) (xi+1) :

Andrea Montanari (Stanford) Stat375: Lecture 3, 4 March 31, 2012 31 / 44

Page 53: Stat 375: Inference in Graphical Models Lectures 3-4montanar/TEACHING/Stat375/LECTURES/lect-3-4.pdf · Stat 375: Inference in Graphical Models Lectures 3-4 Andrea Montanari Stanford

Line graph: Computing marginals

xi�1 xi xi+1

�(xi ) = �i (xi )

Marginals can be computed in jX j2n operations.

Andrea Montanari (Stanford) Stat375: Lecture 3, 4 March 31, 2012 32 / 44

Page 54: Stat 375: Inference in Graphical Models Lectures 3-4montanar/TEACHING/Stat375/LECTURES/lect-3-4.pdf · Stat 375: Inference in Graphical Models Lectures 3-4 Andrea Montanari Stanford

Line graph: Computing the partition function

x1 x2 x3 x4 x5 x6 x7

Zi! = Z(i�1)! eZi! ;eZi! =X

xi ;xi�1

�(i�1)!(xi�1) i�1(xi�1; xi ) ;

Z1! = 1 ;

Zn! = Z :

The partition function can be computed in jX j2n operations.

Andrea Montanari (Stanford) Stat375: Lecture 3, 4 March 31, 2012 33 / 44

Page 55: Stat 375: Inference in Graphical Models Lectures 3-4montanar/TEACHING/Stat375/LECTURES/lect-3-4.pdf · Stat 375: Inference in Graphical Models Lectures 3-4 Andrea Montanari Stanford

Line graph: Computing the partition function

x1 x2 x3 x4 x5 x6 x7

Zi! = Z(i�1)! eZi! ;eZi! =X

xi ;xi�1

�(i�1)!(xi�1) i�1(xi�1; xi ) ;

Z1! = 1 ;

Zn! = Z :

The partition function can be computed in jX j2n operations.

Andrea Montanari (Stanford) Stat375: Lecture 3, 4 March 31, 2012 33 / 44

Page 56: Stat 375: Inference in Graphical Models Lectures 3-4montanar/TEACHING/Stat375/LECTURES/lect-3-4.pdf · Stat 375: Inference in Graphical Models Lectures 3-4 Andrea Montanari Stanford

Example #1: Hidden Markov Models

Sequence of r.v.'s f(X1;Y1); (X2;Y2); : : : ; (Xn ;Yn)g ;

fXig Markov Chain Pfxg = Pfx1gn�1Yi=1

Pfxi+1jxig ;

fYig noisy observations Pfy jxg =nYi=i

Pfyi jxig ;

Andrea Montanari (Stanford) Stat375: Lecture 3, 4 March 31, 2012 34 / 44

Page 57: Stat 375: Inference in Graphical Models Lectures 3-4montanar/TEACHING/Stat375/LECTURES/lect-3-4.pdf · Stat 375: Inference in Graphical Models Lectures 3-4 Andrea Montanari Stanford

Example #1: Hidden Markov Models

Sequence of r.v.'s f(X1;Y1); (X2;Y2); : : : ; (Xn ;Yn)g ;

fXig Markov Chain Pfxg = Pfx1gn�1Yi=1

Pfxi+1jxig ;

fYig noisy observations Pfy jxg =nYi=i

Pfyi jxig ;

Andrea Montanari (Stanford) Stat375: Lecture 3, 4 March 31, 2012 34 / 44

Page 58: Stat 375: Inference in Graphical Models Lectures 3-4montanar/TEACHING/Stat375/LECTURES/lect-3-4.pdf · Stat 375: Inference in Graphical Models Lectures 3-4 Andrea Montanari Stanford

Example #1: Hidden Markov Models

Sequence of r.v.'s f(X1;Y1); (X2;Y2); : : : ; (Xn ;Yn)g ;

fXig Markov Chain Pfxg = Pfx1gn�1Yi=1

Pfxi+1jxig ;

fYig noisy observations Pfy jxg =nYi=i

Pfyi jxig ;

Andrea Montanari (Stanford) Stat375: Lecture 3, 4 March 31, 2012 34 / 44

Page 59: Stat 375: Inference in Graphical Models Lectures 3-4montanar/TEACHING/Stat375/LECTURES/lect-3-4.pdf · Stat 375: Inference in Graphical Models Lectures 3-4 Andrea Montanari Stanford

Example #1:

Time Homogeneous Hidden Markov Models

Sequence of r.v.'s f(X1;Y1); (X2;Y2); : : : ; (Xn ;Yn)g ;

fXig Markov Chain Pfxg = q0(x1)n�1Yi=1

q(xi ; xi+1) ;

fYig noisy observations Pfy jxg =nYi=i

r(xi ; yi ) ;

Parameters: fp(x ; x 0) : x ; x 0 2 Xg, fr(x ; y) : x 2 X ; y 2 Yg

Andrea Montanari (Stanford) Stat375: Lecture 3, 4 March 31, 2012 35 / 44

Page 60: Stat 375: Inference in Graphical Models Lectures 3-4montanar/TEACHING/Stat375/LECTURES/lect-3-4.pdf · Stat 375: Inference in Graphical Models Lectures 3-4 Andrea Montanari Stanford

Example #1:

Time Homogeneous Hidden Markov Models

Sequence of r.v.'s f(X1;Y1); (X2;Y2); : : : ; (Xn ;Yn)g ;

fXig Markov Chain Pfxg = q0(x1)n�1Yi=1

q(xi ; xi+1) ;

fYig noisy observations Pfy jxg =nYi=i

r(xi ; yi ) ;

Parameters: fp(x ; x 0) : x ; x 0 2 Xg, fr(x ; y) : x 2 X ; y 2 Yg

Andrea Montanari (Stanford) Stat375: Lecture 3, 4 March 31, 2012 35 / 44

Page 61: Stat 375: Inference in Graphical Models Lectures 3-4montanar/TEACHING/Stat375/LECTURES/lect-3-4.pdf · Stat 375: Inference in Graphical Models Lectures 3-4 Andrea Montanari Stanford

Example #1:

Time Homogeneous Hidden Markov Models

Sequence of r.v.'s f(X1;Y1); (X2;Y2); : : : ; (Xn ;Yn)g ;

fXig Markov Chain Pfxg = q0(x1)n�1Yi=1

q(xi ; xi+1) ;

fYig noisy observations Pfy jxg =nYi=i

r(xi ; yi ) ;

Parameters: fp(x ; x 0) : x ; x 0 2 Xg, fr(x ; y) : x 2 X ; y 2 Yg

Andrea Montanari (Stanford) Stat375: Lecture 3, 4 March 31, 2012 35 / 44

Page 62: Stat 375: Inference in Graphical Models Lectures 3-4montanar/TEACHING/Stat375/LECTURES/lect-3-4.pdf · Stat 375: Inference in Graphical Models Lectures 3-4 Andrea Montanari Stanford

Example #1:

Time Homogeneous Hidden Markov Models

Sequence of r.v.'s f(X1;Y1); (X2;Y2); : : : ; (Xn ;Yn)g ;

fXig Markov Chain Pfxg = q0(x1)n�1Yi=1

q(xi ; xi+1) ;

fYig noisy observations Pfy jxg =nYi=i

r(xi ; yi ) ;

Parameters: fp(x ; x 0) : x ; x 0 2 Xg, fr(x ; y) : x 2 X ; y 2 Yg

Andrea Montanari (Stanford) Stat375: Lecture 3, 4 March 31, 2012 35 / 44

Page 63: Stat 375: Inference in Graphical Models Lectures 3-4montanar/TEACHING/Stat375/LECTURES/lect-3-4.pdf · Stat 375: Inference in Graphical Models Lectures 3-4 Andrea Montanari Stanford

Example #1: Unconditional

Time Homogeneous Hidden Markov Models

x1 x2 x3 x4 x5 x6 x7

y1 y2 y3 y4 y5 y6 y7

�(x ; y) =1

Z

n�1Yi=1

i (xi ; xi+1)nYi=1

~ i (xi ; yi ) ;

i (xi ; xi+1) = q(xi ; xi+1) ; ~ i (xi ; yi ) = r(xi ; yi ) :

(equivalent directed form

x1 x2 x3 x4 x5 x6 x7

y1 y2 y3 y4 y5 y6 y7

)

Andrea Montanari (Stanford) Stat375: Lecture 3, 4 March 31, 2012 36 / 44

Page 64: Stat 375: Inference in Graphical Models Lectures 3-4montanar/TEACHING/Stat375/LECTURES/lect-3-4.pdf · Stat 375: Inference in Graphical Models Lectures 3-4 Andrea Montanari Stanford

Question

Estimate bx (y) from y as to minimize

ENerr =nXi=1

Pfbxi (y) 6= xig :

Exercise: The optimal estimator is

bxi (y) = argmaxz2X

Pfxi = z jyg :

Computational task.

Compute marginals of (q0 uniform)

�y(x ) = Pfx jyg Bayes thm=

1

Z (y)

n�1Yi=1

q(xi ; xi+1)nYi=1

r(xi ; yi ) :

Andrea Montanari (Stanford) Stat375: Lecture 3, 4 March 31, 2012 37 / 44

Page 65: Stat 375: Inference in Graphical Models Lectures 3-4montanar/TEACHING/Stat375/LECTURES/lect-3-4.pdf · Stat 375: Inference in Graphical Models Lectures 3-4 Andrea Montanari Stanford

Question

Estimate bx (y) from y as to minimize

ENerr =nXi=1

Pfbxi (y) 6= xig :

Exercise: The optimal estimator is

bxi (y) = argmaxz2X

Pfxi = z jyg :

Computational task.

Compute marginals of (q0 uniform)

�y(x ) = Pfx jyg Bayes thm=

1

Z (y)

n�1Yi=1

q(xi ; xi+1)nYi=1

r(xi ; yi ) :

Andrea Montanari (Stanford) Stat375: Lecture 3, 4 March 31, 2012 37 / 44

Page 66: Stat 375: Inference in Graphical Models Lectures 3-4montanar/TEACHING/Stat375/LECTURES/lect-3-4.pdf · Stat 375: Inference in Graphical Models Lectures 3-4 Andrea Montanari Stanford

Question

Estimate bx (y) from y as to minimize

ENerr =nXi=1

Pfbxi (y) 6= xig :

Exercise: The optimal estimator is

bxi (y) = argmaxz2X

Pfxi = z jyg :

Computational task.

Compute marginals of (q0 uniform)

�y(x ) = Pfx jyg Bayes thm=

1

Z (y)

n�1Yi=1

q(xi ; xi+1)nYi=1

r(xi ; yi ) :

Andrea Montanari (Stanford) Stat375: Lecture 3, 4 March 31, 2012 37 / 44

Page 67: Stat 375: Inference in Graphical Models Lectures 3-4montanar/TEACHING/Stat375/LECTURES/lect-3-4.pdf · Stat 375: Inference in Graphical Models Lectures 3-4 Andrea Montanari Stanford

Example #1: Conditional Hidden Markov Models

x1 x2 x3 x4 x5 x6 x7

y1 y2 y3 y4 y5 y6 y7

�y(x ) =1

Z (y)

n�1Yi=1

q(xi ; xi+1)nYi=1

r(xi ; yi )

=1

Z (y)

n�1Yi=1

i (xi ; xi+1)

i (xi ; xi+1) = q(xi ; xi+1) r(xi ; yi ) (for i < n � 1)

n�1(xn�1; xn) = q(xn�1; xn) r(xn�1; yn�1) r(xn ; yn) :

Andrea Montanari (Stanford) Stat375: Lecture 3, 4 March 31, 2012 38 / 44

Page 68: Stat 375: Inference in Graphical Models Lectures 3-4montanar/TEACHING/Stat375/LECTURES/lect-3-4.pdf · Stat 375: Inference in Graphical Models Lectures 3-4 Andrea Montanari Stanford

Example #1: Conditional Hidden Markov Models

x1 x2 x3 x4 x5 x6 x7

y1 y2 y3 y4 y5 y6 y7

�y(x ) =1

Z (y)

n�1Yi=1

q(xi ; xi+1)nYi=1

r(xi ; yi )

=1

Z (y)

n�1Yi=1

i (xi ; xi+1)

i (xi ; xi+1) = q(xi ; xi+1) r(xi ; yi ) (for i < n � 1)

n�1(xn�1; xn) = q(xn�1; xn) r(xn�1; yn�1) r(xn ; yn) :

Andrea Montanari (Stanford) Stat375: Lecture 3, 4 March 31, 2012 38 / 44

Page 69: Stat 375: Inference in Graphical Models Lectures 3-4montanar/TEACHING/Stat375/LECTURES/lect-3-4.pdf · Stat 375: Inference in Graphical Models Lectures 3-4 Andrea Montanari Stanford

Example #1: Computing marginals in HMMs

x1 x2 x3 x4 x5 x6 x7

y1 y2 y3 y4 y5 y6 y7

�i!(xi ) �=X

xi�12X

q(xi�1; xi ) r(xi�1; yi�1) �(i�1)!(xi�1) ;

�i (xi ) �=X

xi+12X

q(xi ; xi+1) r(xi ; yi ) �(i+1) (xi+1) :

(forward-backward algorithm)

Andrea Montanari (Stanford) Stat375: Lecture 3, 4 March 31, 2012 39 / 44

Page 70: Stat 375: Inference in Graphical Models Lectures 3-4montanar/TEACHING/Stat375/LECTURES/lect-3-4.pdf · Stat 375: Inference in Graphical Models Lectures 3-4 Andrea Montanari Stanford

Example #1: Computing marginals in HMMs

x1 x2 x3 x4 x5 x6 x7

y1 y2 y3 y4 y5 y6 y7

�i!(xi ) �=X

xi�12X

q(xi�1; xi ) r(xi�1; yi�1) �(i�1)!(xi�1) ;

�i (xi ) �=X

xi+12X

q(xi ; xi+1) r(xi ; yi ) �(i+1) (xi+1) :

(forward-backward algorithm)

Andrea Montanari (Stanford) Stat375: Lecture 3, 4 March 31, 2012 39 / 44

Page 71: Stat 375: Inference in Graphical Models Lectures 3-4montanar/TEACHING/Stat375/LECTURES/lect-3-4.pdf · Stat 375: Inference in Graphical Models Lectures 3-4 Andrea Montanari Stanford

Example #1B: Linear system

HMM with xi 2 Rk , yi 2 Rh

Markov chain (parameters F ;Q 2 Rk�k , Q � 0)

q(xi ; xi+1) �= expn�

1

2(xi+1 � Fxi )

TQ�1(xi+1 � Fxi )o;

xi � N(Fxi ;Q) :

Observations (parameters H 2 Rh�k , R 2 Rh�h , R � 0)

r(xi ; yi ) �= expn�

1

2(yi �Hxi )

TR�1(yi �Hxi )o;

yi � N(Hxi ;R) :

Forward iteration = Kalman �lter

�i!(xi )�= expn�

1

2(xi � bxi )TP�1i (xi � bxi )o

Exercise: Derive recursions for bxi , Pi .Andrea Montanari (Stanford) Stat375: Lecture 3, 4 March 31, 2012 40 / 44

Page 72: Stat 375: Inference in Graphical Models Lectures 3-4montanar/TEACHING/Stat375/LECTURES/lect-3-4.pdf · Stat 375: Inference in Graphical Models Lectures 3-4 Andrea Montanari Stanford

Example #1B: Linear system

HMM with xi 2 Rk , yi 2 Rh

Markov chain (parameters F ;Q 2 Rk�k , Q � 0)

q(xi ; xi+1) �= expn�

1

2(xi+1 � Fxi )

TQ�1(xi+1 � Fxi )o;

xi � N(Fxi ;Q) :

Observations (parameters H 2 Rh�k , R 2 Rh�h , R � 0)

r(xi ; yi ) �= expn�

1

2(yi �Hxi )

TR�1(yi �Hxi )o;

yi � N(Hxi ;R) :

Forward iteration = Kalman �lter

�i!(xi )�= expn�

1

2(xi � bxi )TP�1i (xi � bxi )o

Exercise: Derive recursions for bxi , Pi .Andrea Montanari (Stanford) Stat375: Lecture 3, 4 March 31, 2012 40 / 44

Page 73: Stat 375: Inference in Graphical Models Lectures 3-4montanar/TEACHING/Stat375/LECTURES/lect-3-4.pdf · Stat 375: Inference in Graphical Models Lectures 3-4 Andrea Montanari Stanford

Example #1B: Linear system

HMM with xi 2 Rk , yi 2 Rh

Markov chain (parameters F ;Q 2 Rk�k , Q � 0)

q(xi ; xi+1) �= expn�

1

2(xi+1 � Fxi )

TQ�1(xi+1 � Fxi )o;

xi � N(Fxi ;Q) :

Observations (parameters H 2 Rh�k , R 2 Rh�h , R � 0)

r(xi ; yi ) �= expn�

1

2(yi �Hxi )

TR�1(yi �Hxi )o;

yi � N(Hxi ;R) :

Forward iteration = Kalman �lter

�i!(xi )�= expn�

1

2(xi � bxi )TP�1i (xi � bxi )o

Exercise: Derive recursions for bxi , Pi .Andrea Montanari (Stanford) Stat375: Lecture 3, 4 March 31, 2012 40 / 44

Page 74: Stat 375: Inference in Graphical Models Lectures 3-4montanar/TEACHING/Stat375/LECTURES/lect-3-4.pdf · Stat 375: Inference in Graphical Models Lectures 3-4 Andrea Montanari Stanford

Example #1C: Neuron �ring patterns

Hypothesis

Assemblies of neurones activate in a coordinate way in correspondence

to speci�c cognitive functions. Performing of the function corresponds

sequence of these activity states.

Approach

Firing process $ Observed variables

Activity states $ Hidden variables

Andrea Montanari (Stanford) Stat375: Lecture 3, 4 March 31, 2012 41 / 44

Page 75: Stat 375: Inference in Graphical Models Lectures 3-4montanar/TEACHING/Stat375/LECTURES/lect-3-4.pdf · Stat 375: Inference in Graphical Models Lectures 3-4 Andrea Montanari Stanford

Example #1C: Neuron �ring patterns

Hypothesis

Assemblies of neurones activate in a coordinate way in correspondence

to speci�c cognitive functions. Performing of the function corresponds

sequence of these activity states.

Approach

Firing process $ Observed variables

Activity states $ Hidden variables

Andrea Montanari (Stanford) Stat375: Lecture 3, 4 March 31, 2012 41 / 44

Page 76: Stat 375: Inference in Graphical Models Lectures 3-4montanar/TEACHING/Stat375/LECTURES/lect-3-4.pdf · Stat 375: Inference in Graphical Models Lectures 3-4 Andrea Montanari Stanford

Example #1C: Neuron �ring patterns

[C. Kemere, G. Santhanam, B. M. Yu, A. Afshar, S.I. Ryu, T. H. Meng and

K.V. Shenoy, J. Neurophysiol. 100:2441-2452 (2008)]

Andrea Montanari (Stanford) Stat375: Lecture 3, 4 March 31, 2012 42 / 44

Page 77: Stat 375: Inference in Graphical Models Lectures 3-4montanar/TEACHING/Stat375/LECTURES/lect-3-4.pdf · Stat 375: Inference in Graphical Models Lectures 3-4 Andrea Montanari Stanford

Example #1C: Neuron �ring patterns

[I. Gat, N. Tishby, and M. Abeles, Network: Computation in Neural Systems,

8:297-322 (1997)]

Andrea Montanari (Stanford) Stat375: Lecture 3, 4 March 31, 2012 43 / 44

Page 78: Stat 375: Inference in Graphical Models Lectures 3-4montanar/TEACHING/Stat375/LECTURES/lect-3-4.pdf · Stat 375: Inference in Graphical Models Lectures 3-4 Andrea Montanari Stanford

Example #1C: Neuron �ring patterns

[C. Kemere, G. Santhanam, B. M. Yu, A. Afshar, S.I. Ryu, T. H. Meng and

K.V. Shenoy, J. Neurophysiol. 100:2441-2452 (2008)]

Andrea Montanari (Stanford) Stat375: Lecture 3, 4 March 31, 2012 44 / 44