Class FasFdr
java.lang.Object
edu.cmu.tetrad.search.work_in_progress.FasFdr
- All Implemented Interfaces:
IFas,IGraphSearch
Implements the "fast adjacency search" used in several causal algorithm in this package. In the fast adjacency
search, at a given stage of the search, an edge X*-*Y is removed from the graph if X _||_ Y | S, where S is a subset
of size d either of adj(X) or of adj(Y), where d is the depth of the search. The fast adjacency search performs this
procedure for each pair of adjacent edges in the graph and for each depth d = 0, 1, 2, ..., d1, where d1 is either
the maximum depth or else the first such depth at which no edges can be removed. The interpretation of this adjacency
search is different for different algorithm, depending on the assumptions of the algorithm. A mapping from {x, y} to
S({x, y}) is returned for edges x *-* y that have been removed.
This variant does each depth twice, gathering up the p values in the first round, using FDR to estimate a cutoff for acceptance, and rerunning using the specified cutoff.
- Author:
- josephramsey.
-
Constructor Summary
ConstructorsConstructorDescriptionFasFdr(IndependenceTest test, int numIndependenceTests) Constructs a new FastAdjacencySearch. -
Method Summary
Modifier and TypeMethodDescriptiongetAmbiguousTriples(Node node) Returns the list of ambiguous triples found for a given node.longReturns the elapsed time of the search.getNodes()Returns the nodes searched over.intReturns the nubmer of independence tests done in the course of the search.Returns a map for x _||_ y | z1,...,zn of {x, y} to {z1,...,zn},search()Discovers all adjacencies in data.voidsetDepth(int depth) Sets the depth of the search--i.e., the maximum number of variables conditioned on for any conditional independence test.voidsetKnowledge(Knowledge knowledge) Sets the knowledge to be used in the search.voidsetOut(PrintStream out) sets the print stream to send text to.voidsetVerbose(boolean verbose) Sets whether verbose output will be printed.
-
Constructor Details
-
FasFdr
Constructs a new FastAdjacencySearch.- Parameters:
test- The independence test to use.numIndependenceTests- The number of independence tests total done.
-
-
Method Details
-
search
Discovers all adjacencies in data. The procedure is to remove edges in the graph which connect pairs of variables which are independent conditional on some other set of variables in the graph (the "sepset"). These are removed in tiers. First, edges which are independent conditional on zero other variables are removed, then edges which are independent conditional on one other variable are removed, then two, then three, and so on, until no more edges can be removed from the graph. The edges which remain in the graph after this procedure are the adjacencies in the data.- Specified by:
searchin interfaceIGraphSearch- Returns:
- a SepSet, which indicates which variables are independent conditional on which other variables
-
getNumIndependenceTests
public int getNumIndependenceTests()Returns the nubmer of independence tests done in the course of the search.- Specified by:
getNumIndependenceTestsin interfaceIFas- Returns:
- This number.
-
getSepsets
Returns a map for x _||_ y | z1,...,zn of {x, y} to {z1,...,zn},- Specified by:
getSepsetsin interfaceIFas- Returns:
- This map.
-
setVerbose
public void setVerbose(boolean verbose) Sets whether verbose output will be printed.- Specified by:
setVerbosein interfaceIFas- Parameters:
verbose- True, if so.
-
getElapsedTime
public long getElapsedTime()Description copied from interface:IFasReturns the elapsed time of the search.- Specified by:
getElapsedTimein interfaceIFas- Returns:
- This time.
-
getNodes
Description copied from interface:IFasReturns the nodes searched over. -
getAmbiguousTriples
Description copied from interface:IFasReturns the list of ambiguous triples found for a given node.- Specified by:
getAmbiguousTriplesin interfaceIFas- Parameters:
node- The node- Returns:
- The list.
- See Also:
-
setOut
Description copied from interface:IFassets the print stream to send text to. -
setDepth
public void setDepth(int depth) Sets the depth of the search--i.e., the maximum number of variables conditioned on for any conditional independence test. -
setKnowledge
Sets the knowledge to be used in the search.- Specified by:
setKnowledgein interfaceIFas- Parameters:
knowledge- This knowledge.
-