Package edu.cmu.tetrad.search
Class FciOrient
java.lang.Object
edu.cmu.tetrad.search.FciOrient
Extends Erin Korber's implementation of the Fast Causal Inference algorithm
(found in FCI.java) with Jiji Zhang's Augmented FCI rules (found in sec. 4.1
of Zhang's 2006 PhD dissertation, "Causal Inference and Reasoning in Causally
Insufficient Systems").
This class is based off a copy of FCI.java taken from the repository on 2008/12/16, revision 7306. The extension is done by extending doFinalOrientation() with methods for Zhang's rules R5-R10 which implements the augmented search. (By a remark of Zhang's, the rule applications can be staged in this way.)
- Author:
- Erin Korber, June 2004, Alex Smith, December 2008, Joseph Ramsey, Choh-Man Teng
-
Constructor Summary
ConstructorsConstructorDescriptionFciOrient
(SepsetProducer sepsets) Constructs a new FCI search for the given independence test and background knowledge. -
Method Summary
Modifier and TypeMethodDescriptionvoid
a method to search "back from a" to find a DDP.void
doFinalOrientation
(Graph graph) Orients the graph according to rules in the graph (FCI step D).void
fciOrientbk
(Knowledge bk, Graph graph, List<Node> variables) Orients according to background knowledgeThe background knowledge.int
The true PAG if available.static boolean
isArrowpointAllowed
(Node x, Node y, Graph graph, Knowledge knowledge) boolean
change flag for repeat rulesboolean
boolean
True iff verbose output should be printed.void
Orients colliders in the graph.void
Implements the double-triangle orientation rule, which states that if D*-oB, A*->Binvalid input: '<'-*C and A*-oDo-*C, and !adj(a, c), D*-oB, then D*->B.void
The triangles that must be oriented this way (won't be done by another rule) all look like the ones below, where the dots are a collider path from L to A with each node on the path (except L) a parent of C.void
Implements Zhang's rule R5, orient circle undirectedPaths: for any Ao-oB, if there is an uncovered circle path u = [A,C,...,D,B] such that A,D nonadjacent and B,C nonadjacent, then A---B and orient every edge on u undirected.void
Implements Zhang's rules R6 and R7, applies them over the graph once.void
rulesR1R2cycle
(Graph graph) void
rulesR8R9R10
(Graph graph) Implements Zhang's rules R8, R9, R10, applies them over the graph once.void
setChangeFlag
(boolean changeFlag) void
setCompleteRuleSetUsed
(boolean completeRuleSetUsed) void
setDoDiscriminatingPathColliderRule
(boolean skip) void
setDoDiscriminatingPathTailRule
(boolean doDiscriminatingPathTailRule) void
setKnowledge
(Knowledge knowledge) void
setMaxPathLength
(int maxPathLength) void
setTruePag
(Graph truePag) void
setVerbose
(boolean verbose)
-
Constructor Details
-
FciOrient
Constructs a new FCI search for the given independence test and background knowledge.
-
-
Method Details
-
orient
-
getSepsets
-
getKnowledge
The background knowledge. -
setKnowledge
-
isCompleteRuleSetUsed
public boolean isCompleteRuleSetUsed()- Returns:
- true if Zhang's complete rule set should be used, false if only R1-R4 (the rule set of the original FCI) should be used. False by default.
-
setCompleteRuleSetUsed
public void setCompleteRuleSetUsed(boolean completeRuleSetUsed) - Parameters:
completeRuleSetUsed
- set to true if Zhang's complete rule set should be used, false if only R1-R4 (the rule set of the original FCI) should be used. False by default.
-
ruleR0
Orients colliders in the graph. (FCI Step C)Zhang's step F3, rule R0.
-
doFinalOrientation
Orients the graph according to rules in the graph (FCI step D).Zhang's step F4, rules R1-R10.
-
rulesR1R2cycle
-
ruleR3
Implements the double-triangle orientation rule, which states that if D*-oB, A*->Binvalid input: '<'-*C and A*-oDo-*C, and !adj(a, c), D*-oB, then D*->B.This is Zhang's rule R3.
-
ruleR4B
The triangles that must be oriented this way (won't be done by another rule) all look like the ones below, where the dots are a collider path from L to A with each node on the path (except L) a parent of C.B xo x is either an arrowhead or a circle / \ v v L....A --> C
This is Zhang's rule R4, discriminating paths.
-
ddpOrient
a method to search "back from a" to find a DDP. It is called with a reachability list (first consisting only of a). This is breadth-first, utilizing "reachability" concept from Geiger, Verma, and Pearl 1990. The body of a DDP consists of colliders that are parents of c. -
ruleR5
Implements Zhang's rule R5, orient circle undirectedPaths: for any Ao-oB, if there is an uncovered circle path u = [A,C,...,D,B] such that A,D nonadjacent and B,C nonadjacent, then A---B and orient every edge on u undirected. -
ruleR6R7
Implements Zhang's rules R6 and R7, applies them over the graph once. Orient single tails. R6: If A---Bo-*C then A---B--*C. R7: If A--oBo-*C and A,C nonadjacent, then A--oB--*C -
rulesR8R9R10
Implements Zhang's rules R8, R9, R10, applies them over the graph once. Orient arrow tails. I.e., tries R8, R9, and R10 in that sequence on each Ao->C in the graph. -
fciOrientbk
Orients according to background knowledge -
isArrowpointAllowed
-
getMaxPathLength
public int getMaxPathLength()- Returns:
- the maximum length of any discriminating path, or -1 of unlimited.
-
setMaxPathLength
public void setMaxPathLength(int maxPathLength) - Parameters:
maxPathLength
- the maximum length of any discriminating path, or -1 if unlimited.
-
isVerbose
public boolean isVerbose()True iff verbose output should be printed. -
setVerbose
public void setVerbose(boolean verbose) -
setTruePag
-
getTruePag
The true PAG if available. Can be null. -
setChangeFlag
public void setChangeFlag(boolean changeFlag) -
isChangeFlag
public boolean isChangeFlag()change flag for repeat rules -
setDoDiscriminatingPathColliderRule
public void setDoDiscriminatingPathColliderRule(boolean skip) -
setDoDiscriminatingPathTailRule
public void setDoDiscriminatingPathTailRule(boolean doDiscriminatingPathTailRule)
-