Package edu.cmu.tetrad.search.utils
Class SepsetsGreedyMb
java.lang.Object
edu.cmu.tetrad.search.utils.SepsetsGreedyMb
- All Implemented Interfaces:
SepsetProducer
Provides a SepsetProducer that selects the first sepset it comes to from among the extra sepsets or the adjacents of
i or k, or null if none is found.
- Version:
- $Id: $Id
- Author:
- josephramsey
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionSepsetsGreedyMb(Graph graph, Graph cpdag, IndependenceTest independenceTest, int depth) Constructor for Sepsets. -
Method Summary
Modifier and TypeMethodDescriptiongetDag()Retrieves the Directed Acyclic Graph (DAG) produced by the Sepsets algorithm.doubleReturns the p-value for the independence test between two nodes, given a set of separator nodes.doublegetScore()Calculates the score for the given Sepsets object.Retrieves the separating set (sepset) between two nodes in the graph.getSepsetContaining(Node i, Node k, Set<Node> s, int depth) Retrieves a sepset (separating set) between two nodes containing a set of nodes, containing the nodes in s, or null if no such sepset is found.Retrieves the variables used in the independence test.booleanisIndependent(Node a, Node b, Set<Node> sepset) Checks if node d is independent of node c given the set of nodes in sepset.booleanisUnshieldedCollider(Node i, Node j, Node k, int depth) isUnshieldedCollider.booleanReturns whether the object is in verbose mode.voidSets the graph for the Sepsets object.voidsetVerbose(boolean verbose) Sets the verbosity level for this object.
-
Constructor Details
-
SepsetsGreedyMb
Constructor for Sepsets.
- Parameters:
graph- aGraphobjectcpdag- The cpdag.independenceTest- aIndependenceTestobjectdepth- a int
-
-
Method Details
-
getSepset
Retrieves the separating set (sepset) between two nodes in the graph. This method finds a subset of adjacent nodes that separate the specified nodes based on the provided parameters.- Specified by:
getSepsetin interfaceSepsetProducer- Parameters:
i- the first nodek- the second nodedepth- the maximum depth of the searchorder- the list representing the order in which nodes are processed- Returns:
- a set of nodes representing the separating set, or an empty set if no such separating set is found
-
getSepsetContaining
Retrieves a sepset (separating set) between two nodes containing a set of nodes, containing the nodes in s, or null if no such sepset is found. If there is no required set of nodes, pass null for the set.- Specified by:
getSepsetContainingin interfaceSepsetProducer- Parameters:
i- The first nodek- The second nodes- The set of nodes that must be contained in the sepset, or null if no such set is required.depth- The depth of the search- Returns:
- The sepset between the two nodes
-
isUnshieldedCollider
isUnshieldedCollider.
- Specified by:
isUnshieldedColliderin interfaceSepsetProducer- Parameters:
i- aNodeobjectj- aNodeobjectk- aNodeobjectdepth- the depth of the search- Returns:
- a boolean
-
isIndependent
Checks if node d is independent of node c given the set of nodes in sepset.- Specified by:
isIndependentin 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
- Throws:
InterruptedException- if any
-
getPValue
Returns the p-value for the independence test between two nodes, given a set of separator nodes.- Specified by:
getPValuein interfaceSepsetProducer- Parameters:
a- the first nodeb- the second nodesepset- the set of separator nodes- Returns:
- the p-value for the independence test
- Throws:
InterruptedException- if any
-
setGraph
Sets the graph for the Sepsets object.- Specified by:
setGraphin interfaceSepsetProducer- Parameters:
graph- The graph to set.
-
getScore
public double getScore()Calculates the score for the given Sepsets object.- Specified by:
getScorein interfaceSepsetProducer- Returns:
- The score calculated based on the result's p-value and the independence test's alpha value.
-
getVariables
Retrieves the variables used in the independence test.- Specified by:
getVariablesin interfaceSepsetProducer- Returns:
- A list of Node objects representing the variables used in the independence test.
-
isVerbose
public boolean isVerbose()Returns whether the object is in verbose mode.- Returns:
- true if the object is in verbose mode, false otherwise
-
setVerbose
public void setVerbose(boolean verbose) Sets the verbosity level for this object. When verbose mode is set to true, additional debugging information will be printed during the execution of this method.- Specified by:
setVerbosein interfaceSepsetProducer- Parameters:
verbose- The verbosity level to set. Set to true for verbose output, false otherwise.
-
getDag
Retrieves the Directed Acyclic Graph (DAG) produced by the Sepsets algorithm.- Returns:
- The DAG produced by the Sepsets algorithm, or null if the independence test is not an instance of MsepTest.
-