Package edu.cmu.tetrad.search.utils
Class SepsetsPossibleMsep
java.lang.Object
edu.cmu.tetrad.search.utils.SepsetsPossibleMsep
- All Implemented Interfaces:
SepsetProducer
Provides a sepset producer using conditional independence tests to generate the Sepset map, for the case where possible msep sets are required.
- Version:
- $Id: $Id
- Author:
- josephramsey
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionSepsetsPossibleMsep
(Graph graph, IndependenceTest test, Knowledge knowledge, int depth, int maxDiscriminatingPathLength) Constructor for SepsetsPossibleMsep. -
Method Summary
Modifier and TypeMethodDescriptiondouble
Returns the p-value for the independence test between two nodes, given a set of separator nodes.double
getScore()
Returns the score of the object.Retrieves the separation set (sepset) between two nodes.getSepsetContaining
(Node i, Node k, Set<Node> s, int depth) Retrieves the separation set (sepset) between two nodes i and k that contains a given set of nodes s.Retrieves the list of variables.boolean
isIndependent
(Node d, Node c, 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.boolean
isVerbose.void
Sets the graph for the SepsetProducer object.void
setVerbose
(boolean verbose) Sets the verbose mode of the SepsetProducer.
-
Constructor Details
-
SepsetsPossibleMsep
public SepsetsPossibleMsep(Graph graph, IndependenceTest test, Knowledge knowledge, int depth, int maxDiscriminatingPathLength) Constructor for SepsetsPossibleMsep.
- Parameters:
graph
- aGraph
objecttest
- aIndependenceTest
objectknowledge
- aKnowledge
objectdepth
- the depth of the searchmaxDiscriminatingPathLength
- the maximum length of discriminating paths
-
-
Method Details
-
getSepset
Retrieves the separation set (sepset) between two nodes.- Specified by:
getSepset
in interfaceSepsetProducer
- Parameters:
i
- The first nodek
- The second nodedepth
- The depth of the search- Returns:
- The set of nodes that form the sepset between node i and node k, or null if no sepset exists
- Throws:
InterruptedException
-
getSepsetContaining
public Set<Node> getSepsetContaining(Node i, Node k, Set<Node> s, int depth) throws InterruptedException Retrieves the separation set (sepset) between two nodes i and k that contains a given set of nodes s. If there is no required set of nodes, pass null for the set.- Specified by:
getSepsetContaining
in interfaceSepsetProducer
- Parameters:
i
- The first nodek
- The second nodes
- The set of nodes to be contained in the sepsetdepth
- The depth of the search- Returns:
- The set of nodes that form the sepset between node i and node k and contains all nodes from set s, or null if no sepset exists
- Throws:
InterruptedException
-
isUnshieldedCollider
isUnshieldedCollider.
- Specified by:
isUnshieldedCollider
in interfaceSepsetProducer
- Parameters:
i
- aNode
objectj
- aNode
objectk
- aNode
objectdepth
- the depth of the search- Returns:
- a boolean
- Throws:
InterruptedException
-
getScore
public double getScore()Returns the score of the object.- Specified by:
getScore
in interfaceSepsetProducer
- Returns:
- the score value
-
getVariables
Retrieves the list of variables.- Specified by:
getVariables
in interfaceSepsetProducer
- Returns:
- the list of variables as a
List
ofNode
objects.
-
isVerbose
public boolean isVerbose()isVerbose.
- Returns:
- a boolean
-
setVerbose
public void setVerbose(boolean verbose) Sets the verbose mode of the SepsetProducer.- Specified by:
setVerbose
in interfaceSepsetProducer
- Parameters:
verbose
- true if verbose mode is enabled, false otherwise
-
isIndependent
Checks if node d is independent of node c given the set of nodes in sepset.- Specified by:
isIndependent
in interfaceSepsetProducer
- Parameters:
d
- the first nodec
- the second nodesepset
- the set of common neighbors between d and c- Returns:
- true if d is independent of c, false otherwise
- Throws:
InterruptedException
-
getPValue
Returns the p-value for the independence test between two nodes, given a set of separator nodes.- Specified by:
getPValue
in interfaceSepsetProducer
- Parameters:
a
- the first nodeb
- the second nodesepset
- the set of separator nodes- Returns:
- the p-value for the independence test
- Throws:
InterruptedException
-
setGraph
Description copied from interface:SepsetProducer
Sets the graph for the SepsetProducer object.- Specified by:
setGraph
in interfaceSepsetProducer
- Parameters:
graph
- the graph to set
-