Meek Rules Algorithm
- class pyagrum.MeekRules
MeekRules class applies the Meek rules to a mixed graph or a PDAG (Partially Directed Acyclic Graph) in order to propagate its orientations:
pyagrum.MeekRules.propagateToCPDAGgives a completed PDAG,pyagrum.MeekRules.propagateToDAGa DAG.The Meek rules orient the edges whose orientation is implied by the arcs of the graph (no new v-structure, no directed cycle). Applied to an extendable PDAG, they give its maximal orientation: a CPDAG when the arcs are only the v-structures of a Markov equivalence class, an MPDAG when some arcs come from background knowledge.
Scientific notes
MeekRules applies the four orientation rules of [1]. Each rule orients an undirected edge
\(a - b\) into \(a \to b\) when the other orientation would create a new v-structure or a directed cycle in
every consistent extension (see pyagrum.PDAG):
R1: \(c \to a - b\), with \(c\) and \(b\) non adjacent;
R2: \(a \to c \to b\) and \(a - b\);
R3: \(a - c \to b\) and \(a - d \to b\), with \(c\) and \(d\) non adjacent;
R4: \(a - c \to d \to b\), with \(a\) adjacent to \(d\) and \(c\), \(b\) non adjacent.
The closure of an extendable PDAG under these rules is unique: it orients exactly the edges that have the same
orientation in all its consistent extensions, its maximally oriented PDAG (pyagrum.MPDAG). When its arcs are those of
its v-structures, R1-R3 suffice and the closure is the CPDAG of its extensions (pyagrum.CPDAG)
[1] (Theorems 3 and 4). For such an input, propagate and propagateToCPDAG compute the
closure in a single pass over a topological order of a consistent extension (Algorithm 2 of
[2]).
Input not extendable (a constraint-based learner may produce one from conflicting tests). The rules are applied
node after node until nothing changes, so that the result depends on the order of the nodes; an edge that receives
both orientations becomes a double arc, recorded in choices. propagateToCPDAG then keeps, for each double arc,
the orientation of an existing directed path between its ends; without such a path, the arc into the node with fewer
parents (then fewer neighbours); with a path in both directions, both arcs are erased. An arc doubled by an edge keeps
the arc. Only these 2-cycles are resolved: a longer directed cycle raises an error.
Orientation into a DAG (propagateToDAG). The closure is oriented with small conditional probability tables:
the total size \(\sum_X |X| \prod_{P \in pa(X)} |P|\) of the CPTs is minimized, \(|X|\) being the domain size
given for \(X\) (all equal by default). In the exact case, an extendable input whose closure gives the same parents
to all the nodes of an undirected component (always true for a CPDAG), each component \(H\) is a connected chordal
graph oriented independently. Every orientation of \(H\) without v-structure starts with a maximal clique
\(K\), after which the remaining components \(C\) are again independent; the recursion of the counting
algorithm Clique-Picking [3][4] is used here for a minimum:
memoized on the components, the nodes of \(K\) being ordered by increasing domain size. The components with more
than pyagrum.config["graph", "orientAsDAGExactMaxSize"] nodes (100 by default), or without common parents
(background knowledge), are oriented by the algorithm of [5], which removes at each step the
potential sink with the smallest CPT: a consistent extension, with no guarantee of minimality. A non extendable input
gets new v-structures (a node without child is then removed as if it were a sink). The orientations of the edges
left undirected by propagateToCPDAG are added to choices.
Methods
Returns the list of the arbitrary choices made by the last execution of |
|
Apply Meek rules R1–R4 to orient edges in a mixed graph. |
|
Propagates the orientations of the graph according to the Meek rules, applied until no rule applies anymore. |
|
Calls |