Finding Optimal Bayesian Networks with Greedy

Finding Optimal Bayesian
Networks with Greedy Search
Max Chickering
Outline
•
•
•
•
Bayesian-Network Definitions
Learning
Greedy Equivalence Search (GES)
Optimality of GES
Bayesian Networks
Use B = (S,) to represent p(X1, …, Xn)
n
p ( X 1 ,..., X n | S ,  )   p ( X i | Par (X i ),  i )
i 1
Markov Conditions
From factorization: I(X, ND | Par(X))
ND
Par
Par
Par
X
Desc
ND
Desc
Markov Conditions + Graphoid Axioms
characterize all independencies
Structure/Distribution Inclusion
All distributions
p
X
Y
Z
S
p is included in S if there exists  s.t. B(S,) defines p
Structure/Structure Inclusion
T≤S
All distributions
X
Y
Z
S
X
Y
Z
T
T is included in S if every p included in T is included in S
(S is an I-map of T)
Structure/Structure Equivalence
TS
All distributions
X
Y
Z
X
S
Reflexive, Symmetric, Transitive
Y
T
Z
Equivalence
A
B
C
A
B
D
V-structure
D
Skeleton
Theorem (Verma and Pearl, 1990)
S  T  same v-structures and skeletons
C
Learning Bayesian Networks
iid
samples
X
0
1
0
p*
1
Y
1
0
1
.
.
.
0
X
Z
1
1
0
Y
1
Z
Generative
Distribution
Observed Data
Learned
Model
1. Learn the structure
2. Estimate the conditional distributions
Learning Structure
• Scoring criterion
F(D, S)
• Search procedure
Identify one or more structures with high values
for the scoring function
Properties of Scoring Criteria
• Consistent
• Locally Consistent
• Score Equivalent
Consistent Criterion
Criterion favors (in the limit) simplest model that
includes the generative distribution p*
X
p*
X
Y
Z
X
Y
Z
X
Y
Y
Z
Z
S includes p*, T does not include p*
 F(S,D) > F(T,D)
Both include p*, S has fewer parameters  F(S,D) > F(T,D)
Locally Consistent Criterion
S and T differ by one edge:
X
Y
S
If I(X,Y|Par(X)) in p* then
Otherwise
X
Y
T
F(S,D) > F(T,D)
F(S,D) < F(T,D)
Score-Equivalent Criterion
Y
X
S
Y
X
T
ST  F(S,D) = F(T,D)
Bayesian Criterion
(Consistent, locally consistent and score equivalent)
Sh : generative distribution p* has same
independence constraints as S.
FBayes(S,D) = log p(Sh |D)
= k + log p(D|Sh) + log p(Sh)
Marginal Likelihood
(closed form w/ assumptions)
Structure Prior
(e.g. prefer simple)
Search Procedure
• Set of states
• Representation for the states
• Operators to move between states
• Systematic Search Algorithm
Greedy Equivalence Search
• Set of states
Equivalence classes of DAGs
• Representation for the states
Essential graphs
• Operators to move between states
Forward and Backward Operators
• Systematic Search Algorithm
Two-phase Greedy
Representation: Essential Graphs
A
B
C
Compelled Edges
Reversible Edges
D
E
F
A
B
C
D
E
F
GES Operators
Forward Direction – single edge additions
Backward Direction – single edge deletions
Two-Phase Greedy Algorithm
Phase 1: Forward Equivalence Search (FES)
• Start with all-independence model
• Run Greedy using forward operators
Phase 2: Backward Equivalence Search (BES)
• Start with local max from FES
• Run Greedy using backward operators
Forward Operators
• Consider all DAGs in the current state
• For each DAG, consider all single-edge
additions (acyclic)
• Take the union of the resulting equivalence
classes
Forward-Operators Example
Current State:
A
All DAGs:
B
A
C
B
A
C
C
All DAGs resulting from single-edge addition:
A
B
A
C
A
B
A
C
B
A
C
B
A
C
B
A
C
B
C
B
A
C
B
C
Union of corresponding essential graphs:
A
B
C
A
B
C
A
B
C
B
A
B
C
Forward-Operators Example
A
B
C
A
B
A
C
B
C
A
B
C
B
C
A
Backward Operators
• Consider all DAGs in the current state
• For each DAG, consider all single-edge
deletions
• Take the union of the resulting equivalence
classes
Backward-Operators Example
Current State:
A
B
All DAGs:
A
C
B
A
C
B
A
C
B
C
All DAGs resulting from single-edge deletion:
A
B
A
C
B
C
A
B
A
C
C
Union of corresponding essential graphs:
A
B
C
B
A
B
C
A
B
C
A
B
C
Backward-Operators Example
A
B
C
A
B
C
A
B
C
DAG Perfect
DAG-perfect distribution p
Exists DAG G:
I(X,Y|Z) in p  I(X,Y|Z) in G
Non-DAG-perfect distribution q
A
B
A
B
A
B
C
D
C
D
C
D
I(A,D|B,C)
I(B,C|A,D)
I(B,C|A,D)
I(A,D|B,C)
DAG-Perfect Consequence:
Composition Axiom Holds in p*
If I(X,Y | Z) then I(X,Y | Z)
for some singleton Y  Y
A
B
C
X
D
C
X
Optimality of GES
If p* is DAG-perfect wrt some G*
X
X
Y
Y
Z
Z
G*
S*
iid
samples
XY
0 1
1 0
0 1
.
.
.
1 0
Z
1
1
0
X
n
Y
GES
Z
1
S
p*
For large n, S = S*
Optimality of GES
BES
FES
All-independence
State includes S*
State equals S*
Proof Outline
• After first phase (FES), current state includes S*
• After second phase (BES), the current state = S*
FES Maximum Includes S*
Assume: Local Max does NOT include S*
Any DAG G from S
Markov Conditions characterize independencies:
In p*, exists X not indep. non-desc given parents
A
B
C
D
E
X
 I(X,{A,B,C,D} | E) in p*
p* is DAG-perfect  composition axiom holds
A
B
C
D
E
X
 I(X,C | E) in p*
Locally consistent: adding CX edge improves score, and EQ class is
a neighbor
BES Identifies S*
• Current state always includes S*:
Local consistency of the criterion
• Local Minimum is S*:
Meek’s conjecture
Meek’s Conjecture
Any pair of DAGs G,H such that H includes G (G ≤ H)
There exists a sequence of
(1) covered edge reversals in G
(2) single-edge additions to G
after each change G ≤ H
after all changes G=H
Meek’s Conjecture
A
B
C
D
I(A,B)
I(C,B|A,D)
H
A
B
A
B
A
B
A
B
C
D
C
D
C
D
C
D
G
Meek’s Conjecture and BES
S*≤S
Assume: Local Max S Not S*
Add
G
Rev
Any DAG H from S
Rev
Add
Any DAG G from S*
Rev
H
Meek’s Conjecture and BES
S*≤S
Assume: Local Max S Not S*
Add
Rev
Any DAG H from S
Rev
Add
Any DAG G from S*
Rev
G
H
Del
G
Rev
Rev
Del
Rev
H
Meek’s Conjecture and BES
S*≤S
Assume: Local Max S Not S*
Add
Rev
Any DAG H from S
Rev
Add
Any DAG G from S*
Rev
G
H
Del
Rev
Rev
Del
Rev
G
S*
H
Neighbor of S in BES
S
Discussion Points
• In practice, GES is as fast as DAG-based
search
Neighborhood of essential graphs can be
generated and scored very efficiently
• When DAG-perfect assumption fails, we still
get optimality guarantees
As long as composition holds in generative
distribution, local maximum is inclusion-minimal
Thanks!
My Home Page:
http://research.microsoft.com/~dmax
Relevant Papers:
“Optimal Structure Identification with Greedy Search”
JMLR Submission
Contains detailed proofs of Meek’s conjecture and optimality of GES
“Finding Optimal Bayesian Networks”
UAI02 Paper with Chris Meek
Contains extension of optimality results of GES when not DAG perfect
Bayesian Criterion is Locally
Consistent
• Bayesian score approaches BIC + constant
n
BIC ( S , D)   F ( X i , Par (X i ))
• BIC is decomposible:
i 1
• Difference in score same for any DAGS that differ by YX edge if X
has same parents
X
Y
X
Y
Complete network (always includes p*)
Bayesian Criterion is Consistent
Assume Conditionals:
(1) unconstrained multinomials
(2) linear regressions
Geiger, Heckerman, King and Meek (2001)
Network structures = curved exponential models
Haughton (1988)
Bayesian Criterion is consistent
Bayesian Criterion is
Score Equivalent
ST  F(S,D) = F(T,D)
X
Y
Sh : no independence constraints
Y
Th : no independence constraints
S
X
T
Sh = Th
Active Paths
Z-active Path between X and Y: (non-standard)
1. Neither X nor Y is in Z
2. Every pair of colliding edges meets at a member of Z
3. No other pair of edges meets at a member of Z
X
Z
Y
G ≤ H  If Z-active path between X and Y in G
then Z-active path between X and Y in H
Active Paths
X
A
Z
W
B
Y
• X-Y: Out-of X and In-to Y
• X-W Out-of both X and W
• Any sub-path between A,BZ is also active
A
B
• A – B, B – C, at least one is out-of B
Active path between A and C
C
Simple Active Paths
B
A
contains YX
Then  active path
(1) Edge appears exactly once
OR
A
Y
X
B
(2) Edge appears exactly twice
A
Y
X
X
Y
B
Simplify discussion:
Assume (1) only – proofs for (2) almost identical
Typical Argument:
Combining Active Paths
A
X
Y
B
X
Z
G
Y
Z sink node
adj X,Y
Z
H
A
X
Y
Z
B
A
X
Y
B
G’ : Suppose AP in G’ (X not in CS) with no
corresp. AP in H. Then Z not in CS.
G≤H
Proof Sketch
Two DAGs G, H with G<H
Identify either:
(1) a covered edge XY in G that has
opposite orientation in H
(2) a new edge XY to be added to G such
that it remains included in H
The Transformation
Choose any node Y that is a sink in H
Case 1a: Y is a sink in G
X  ParH(Y)
X  ParG(Y)
Y
Case 1b: Y is a sink in G
same parents
Y
X
Y
X
X
Y
X
Case 2a: X s.t. YX
covered
Y
Case 2b: X s.t. YX & W
par of Y but not X
Case 2c: Every YX,
Par (Y)  Par(X)
W
Y
Y
W
X
Y
Y
X
Preliminaries
(G ≤ H)
• The adjacencies in G are a subset of the
adjacencies in H
• If XYZ is a v-structure in G but not H,
then X and Z are adjacent in H
• Any new active path that results from
adding XY to G includes XY
Proof Sketch: Case 1
Y is a sink in G
Case 1a:
X  ParH(Y)
X  ParG(Y)
H:
Y
X
G:
Y
X
Y
X
Suppose there’s some new active path between A and B not in H
A
Z
Y
X
B
1. Y is a sink in G, so it must be in CS
2. Neither X nor next node Z is in CS
3. In H, AP(A,Z), AP(X,B), ZYX
Case 1b: Parents identical
Remove Y from both graphs: proof similar
Proof Sketch: Case 2
Y is not a sink in G
Case 2a: There is a covered edge YX : Reverse the edge
Case 2b: There is a non-covered edge YX such that W is a
parent of Y but not a parent of X
W
W
G’:
G:
Y
W
H:
X
Y
X
X
Y
Suppose there’s some new active path between A and B not in H
Y must be in CS, else replace WX by W  Y  X (not new).
If X not in CS, then in H active: A-W, X-B, WYX
G’:
A
A
B
W
B
W
H:
Y
X
Z
Y
X
Z
Case 2c: The Difficult Case
All non-covered edges YZ have Par(Y)  Par(Z)
W1
W2
W1
Y
Z1
Y
Z2
G
W2
Z1
Z2
H
W1Y: G no longer < H (Z2-active path between W1 and W2)
W2Y: G < H
Choosing Z
D
G
H
Y
Y
Z
Descendants of Y in G
D
Descendants of Y in G
D is the maximal G-descendant in H
Z is any maximal child of Y such that D is a descendant of Z in G
Choosing Z
W1
W2
W1
Y
Z1
W2
Y
Z2
Z1
G
Descendants of Y in G:
Y, Z1, Z2
Maximal descendant in H:
D=Z2
Maximal child of Y in G that has D=Z2 as descendant
Z2
Add W2Y
Z2
H
Difficult Case: Proof Intuition
B
Y
W
Z
B or CS
D
G
A
B
B or CS
Y
W
Z
D
H
1. W not in CS
2. Y not in CS, else active in H
3. In G, next edges must be away from Y until B or CS reached
4. In G, neither Z nor desc in CS, else active before addition
5. From (1,2,4), AP (A,D) and (B,D) in H
6. Choice of D: directed path from D to B or CS in H
A
Optimality of GES
Definition
p is DAG-perfect wrt G:
Independence constraints in p are precisely those in G
Assumption
Generative distribution p* is perfect wrt some G* defined
over the observable variables
S* = Equivalence class containing G*
Under DAG-perfect assumption, GES results in S*
Important Definitions
•
•
•
•
Bayesian Networks
Markov Conditions
Distribution/Structure Inclusion
Structure/Structure Inclusion