Package edu.cmu.tetrad.search
Class Fasd
java.lang.Object
edu.cmu.tetrad.search.Fasd
- All Implemented Interfaces:
IFas,IGraphSearch
Adjusts FAS (see) for the deterministic case by refusing to removed edges based on conditional independence tests
that are judged to be deterministic. That is, if X _||_ Y | Z, but Z determines X or Y, then the edge X---Y is not
removed.
This class is configured to respect knowledge of forbidden and required edges, including knowledge of temporal tiers.
- Version:
- $Id: $Id
- Author:
- peterspirtes, josephramsey.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintReturns the number of conditional independence tests done in the course of search.Returns the map of node pairs to sepsets from the search.booleanReturns the current value of the verbose flag.search()Discovers all adjacencies in data.voidsetDepth(int depth) Sets the depth of the search.voidsetExternalGraph(Graph externalGraph) Sets the external graph.voidsetKnowledge(Knowledge knowledge) Sets the knowledge for this object.voidsetReplicatingGraph(boolean replicatingGraph) Sets whether the adjacency search should use a replicating graph.voidsetStable(boolean stable) Sets whether the adjacency search should be stable.voidsetVerbose(boolean verbose) Sets the verbose flag to control verbose output.Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface edu.cmu.tetrad.search.IGraphSearch
getTest, setTest
-
Constructor Details
-
Fasd
Constructs a new FastAdjacencySearch.- Parameters:
test- A test to use as a conditional independence oracle.
-
-
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 interfaceIFas- Specified by:
searchin interfaceIGraphSearch- Returns:
- a graph which indicates which variables are independent conditional on which other variables
-
setDepth
public void setDepth(int depth) Sets the depth of the search.- Specified by:
setDepthin interfaceIFas- Parameters:
depth- The maximum search depth. Must be -1 (unlimited) or >= 0.- Throws:
IllegalArgumentException- if depth is less than -1
-
setKnowledge
Sets the knowledge for this object.- Specified by:
setKnowledgein interfaceIFas- Parameters:
knowledge- The knowledge to set. Cannot be null.- Throws:
NullPointerException- If knowledge is null.
-
getNumIndependenceTests
public int getNumIndependenceTests()Returns the number of conditional independence tests done in the course of search.- Returns:
- This number.
-
getSepsets
Returns the map of node pairs to sepsets from the search.- Specified by:
getSepsetsin interfaceIFas- Returns:
- This map.
-
setExternalGraph
Sets the external graph. Adjacencies not in this external graph will not be judged adjacent in the search result.- Parameters:
externalGraph- This graph.
-
isVerbose
public boolean isVerbose()Returns the current value of the verbose flag.- Returns:
- true if verbose output is enabled, false otherwise.
-
setVerbose
public void setVerbose(boolean verbose) Sets the verbose flag to control verbose output.- Specified by:
setVerbosein interfaceIFas- Parameters:
verbose- True, if verbose output is enabled. False otherwise.
-
setStable
public void setStable(boolean stable) Description copied from interface:IFasSets whether the adjacency search should be stable. When set totrue, the search process ensures that reversing the order of variable consideration does not affect the result of the adjacency search. -
setReplicatingGraph
public void setReplicatingGraph(boolean replicatingGraph) Description copied from interface:IFasSets whether the adjacency search should use a replicating graph. When set totrue, the search process may involve duplicating certain graph structures or information for concurrent or experimental purposes.- Specified by:
setReplicatingGraphin interfaceIFas- Parameters:
replicatingGraph- a boolean flag indicating whether the search process should involve a replicating graph.
-