Package edu.cmu.tetrad.graph
Class Paths
java.lang.Object
edu.cmu.tetrad.graph.Paths
- All Implemented Interfaces:
- TetradSerializable,- Serializable
- See Also:
- 
Nested Class SummaryNested Classes
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionallDirectedPathsFromTo(Node node1, Node node2, int maxLength) allPathsFromTo(Node node1, Node node2, int maxLength) booleandefiniteNonDescendent(Node node1, Node node2) added by ekorber, 2004/06/12booleandefVisible(Edge edge) added by ekorber, 2004/06/11directedPathsFromTo(Node node1, Node node2, int maxLength) booleanbooleanexistsDirectedPathFromTo(Node node1, Node node2) booleanexistsDirectedPathFromTo(Node node1, Node node2, int depth) booleanexistsInducingPath(Node x, Node y) Determines whether an inducing path exists between node1 and node2, given a set O of observed nodes and a set sem of conditioned nodes.booleanexistsInducingPathVisit(Node a, Node b, Node x, Node y, LinkedList<Node> path) booleanexistsSemiDirectedPath(Node from, Node to) booleanexistsSemiDirectedPath(Node node1, Set<Node> nodes) booleanexistsTrek(Node node1, Node node2) Determines whether a trek exists between two nodes in the graph.Return a map from each node to its ancestors.getAncestors(List<Node> nodes) getDescendants(List<Node> nodes) getInducingPath(Node x, Node y) getMConnectedVars(Node y, Set<Node> z) getValidOrder(List<Node> initialOrder, boolean forward) Returns a valid causal order for either a DAG or a CPDAG.booleanisAncestorOf(Node node1, Node node2) Determines whether one node is an ancestor of another.booleanisDescendentOf(Node node1, Node node2) Determines whether one node is a descendent of another.booleanisDirectedFromTo(Node node1, Node node2) booleanisMConnectedTo(Node x, Node y, Set<Node> z) Detemrmines whether x and y are d-connected given z.booleanDetemrmines whether x and y are d-connected given z.booleanbooleanChecks to see if x and y are d-connected given z.booleanisMSeparatedFrom(Node node1, Node node2, Set<Node> z) Determines whether one n ode is d-separated from another.booleanbooleanCheck to see if a set of variables Z satisfies the back-door criterion relative to node x and node y.booleanisUndirectedFromTo(Node node1, Node node2) voidmakeValidOrder(List<Node> order) booleanpossibleAncestor(Node node1, Node node2) possibleMsep(Node x, Node y, int maxPathLength) voidremoveByPossibleMsep(IndependenceTest test, SepsetMap sepsets) Remove edges by the possible m-separation rule.semidirectedPathsFromTo(Node node1, Node node2, int maxLength) treksIncludingBidirected(Node node1, Node node2) 
- 
Constructor Details- 
Paths
 
- 
- 
Method Details- 
getValidOrderReturns a valid causal order for either a DAG or a CPDAG. (bryanandrews)- Parameters:
- initialOrder- Variables in the order will be kept as close to this initial order as possible, either the forward order or the reverse order, depending on the next parameter.
- forward- Whether the variables will be iterated over in forward or reverse direction.
- Returns:
- The valid causal order found.
 
- 
makeValidOrder
- 
maxCliques
- 
connectedComponents- Returns:
- the connected components of the given graph, as a list of lists of nodes.
 
- 
directedPathsFromTo
- 
semidirectedPathsFromTo
- 
allPathsFromTo
- 
allDirectedPathsFromTo
- 
treks
- 
treksIncludingBidirected
- 
existsDirectedPathFromTo
- 
existsSemiDirectedPath
- 
isMConnectedTo
- 
isMConnectedTopublic boolean isMConnectedTo(Set<Node> x, Set<Node> y, Set<Node> z, Map<Node, Set<Node>> ancestorMap) Checks to see if x and y are d-connected given z.- Parameters:
- ancestorMap- A map of nodes to their ancestors.
- Returns:
- True if x and y are d-connected given z.
 
- 
getMConnectedVars
- 
getMConnectedVars
- 
getAncestorMapReturn a map from each node to its ancestors.- Returns:
- This map.
 
- 
existsInducingPathDetermines whether an inducing path exists between node1 and node2, given a set O of observed nodes and a set sem of conditioned nodes.- Parameters:
- x- the first node.
- y- the second node.
- Returns:
- true if an inducing path exists, false if not.
 
- 
existsInducingPathVisit
- 
getInducingPath
- 
possibleMsep
- 
removeByPossibleMsepRemove edges by the possible m-separation rule.- Parameters:
- test- The independence test to use to remove edges.
- sepsets- A sepset map to which sepsets should be added. May be null, in which case sepsets will not be recorded.
 
- 
isSatisfyBackDoorCriterionCheck to see if a set of variables Z satisfies the back-door criterion relative to node x and node y.
- 
getSepset
- 
isMConnectedToDetemrmines whether x and y are d-connected given z.- Returns:
- true if x and y are d-connected given z; false otherwise.
 
- 
isMConnectedToDetemrmines whether x and y are d-connected given z.- Returns:
- true if x and y are d-connected given z; false otherwise.
 
- 
defVisibleadded by ekorber, 2004/06/11- Returns:
- true if the given edge is definitely visible (Jiji, pg 25)
- Throws:
- IllegalArgumentException- if the given edge is not a directed edge in the graph
 
- 
existsDirectedCyclepublic boolean existsDirectedCycle()
- 
existsDirectedPathFromTo- Returns:
- true iff there is a (nonempty) directed path from node1 to node2. a
 
- 
existsSemiDirectedPath
- 
existsTrekDetermines whether a trek exists between two nodes in the graph. A trek exists if there is a directed path between the two nodes or else, for some third node in the graph, there is a path to each of the two nodes in question.
- 
getDescendants
- 
isAncestorOfDetermines whether one node is an ancestor of another.
- 
getAncestors
- 
isDescendentOfDetermines whether one node is a descendent of another.
- 
definiteNonDescendentadded by ekorber, 2004/06/12- Returns:
- true iff node2 is a definite nondecendent of node1
 
- 
isMSeparatedFromDetermines whether one n ode is d-separated from another. According to Spirtes, Richardson and Meek, two nodes are d- connected given some conditioning set Z if there is an acyclic undirected path U between them, such that every collider on U is an ancestor of some element in Z and every non-collider on U is not in Z. Two elements are d-separated just in case they are not d-connected. A collider is a node which two edges hold in common for which the endpoints leading into the node are both arrow endpoints.- Parameters:
- node1- the first node.
- node2- the second node.
- z- the conditioning set.
- Returns:
- true if node1 is d-separated from node2 given set t, false if not.
- See Also:
 
- 
isMSeparatedFrom
- 
isDirectedFromTo
- 
isUndirectedFromTo
- 
possibleAncestor
 
-