Package edu.cmu.tetrad.search.utils
Class DagSepsets
java.lang.Object
edu.cmu.tetrad.search.utils.DagSepsets
- All Implemented Interfaces:
SepsetProducer
Determines sepsets, collider, and noncolliders by examining d-separation facts in a DAG.
- Version:
- $Id: $Id
- Author:
- josephramsey
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetDag()
Returns the DAG being analyzed.double
Calculates the p-value for a statistical test a _||_ b | sepset.double
getScore()
Returns the score of the object.Retrieves the sepset, which is the set of common neighbors between two given nodes.getSepsetContaining
(Node a, Node b, Set<Node> s, int depth) Returns the sepset containing nodes 'a' and 'b' that also contains all the nodes in the given set 's'.Retrieves the list of variables.boolean
isIndependent
(Node a, Node b, Set<Node> sepset) Checks if node d is independent of node c given the set of nodes in sepset.boolean
isUnshieldedCollider
(Node i, Node j, Node k, int depth) isUnshieldedCollider.void
Sets the graph for the SepsetProducer object.void
setVerbose
(boolean verbose) Sets the verbose mode of the SepsetProducer.
-
Constructor Details
-
DagSepsets
Constructs a new DagSepsets object for the given DAG.- Parameters:
dag
- the DAG.
-
-
Method Details
-
getSepset
Retrieves the sepset, which is the set of common neighbors between two given nodes.Returns the list of sepset for {a, b}.
- Specified by:
getSepset
in interfaceSepsetProducer
- Parameters:
a
- the first nodeb
- the second nodedepth
- the depth of the search- Returns:
- the set of common neighbors between nodes a and b
-
getSepsetContaining
Returns the sepset containing nodes 'a' and 'b' that also contains all the nodes in the given set 's'. Note that for the DAG case, it is expected that any sepset containing 'a' and 'b' will contain all the nodes in 's'; otherwise, an exception is thrown.- Specified by:
getSepsetContaining
in interfaceSepsetProducer
- Parameters:
a
- The first node.b
- The second node.s
- The set of nodes that must be contained in the sepset.depth
- The depth of the search.- Returns:
- The sepset containing 'a' and 'b' that also contains all the nodes in 's'.
- Throws:
IllegalArgumentException
- If the sepset of 'a' and 'b' does not contain all the nodes in 's'.
-
isUnshieldedCollider
isUnshieldedCollider.
True iff i*-*j*-*k is an unshielded collider.
- Specified by:
isUnshieldedCollider
in interfaceSepsetProducer
- Parameters:
i
- aNode
objectj
- aNode
objectk
- aNode
objectdepth
- the depth of the search- Returns:
- a boolean
-
getScore
public double getScore()Returns the score of the object.Not implemented; required for an interface.
- Specified by:
getScore
in interfaceSepsetProducer
- Returns:
- the score value
-
isIndependent
Checks if node d is independent of node c given the set of nodes in sepset.Returns true just in case msep(a, b | c) in the DAG. Don't let the name isIndependent fool you; this is a d-separation method. We only use the name isIndependent so that this can be used in place of an independence check.
- Specified by:
isIndependent
in interfaceSepsetProducer
- Parameters:
a
- the first nodeb
- the second nodesepset
- the set of common neighbors between d and c- Returns:
- true if d is independent of c, false otherwise
-
getPValue
Description copied from interface:SepsetProducer
Calculates the p-value for a statistical test a _||_ b | sepset.- Specified by:
getPValue
in interfaceSepsetProducer
- Parameters:
a
- the first nodeb
- the second nodesepset
- the set of nodes- Returns:
- the p-value for the statistical test
- Throws:
UnsupportedOperationException
- if this method is called.
-
setGraph
Description copied from interface:SepsetProducer
Sets the graph for the SepsetProducer object.- Specified by:
setGraph
in interfaceSepsetProducer
- Parameters:
graph
- the graph to set
-
getVariables
Retrieves the list of variables.Returns the nodes in the DAG.
- Specified by:
getVariables
in interfaceSepsetProducer
- Returns:
- the list of variables as a
List
ofNode
objects.
-
setVerbose
public void setVerbose(boolean verbose) Sets the verbose mode of the SepsetProducer.Thsi method is not used.
- Specified by:
setVerbose
in interfaceSepsetProducer
- Parameters:
verbose
- true if verbose mode is enabled, false otherwise
-
getDag
-