Package edu.cmu.tetrad.search
Class PcStableMax
java.lang.Object
edu.cmu.tetrad.search.PcStableMax
- All Implemented Interfaces:
GraphSearch
Implements a modification of the the PC ("Peter/Clark") algorithm, as specified in Chapter 6 of
Spirtes, Glymour, and Scheines, Causation, Prediction, and Search, 2nd edition, using the rule set
in step D due to Chris Meek. For the modified rule set, see Chris Meek (1995), "Causal inference and
causal explanation with background knowledge." The modification is to replace the collider orientation
step by a scoring step.
- Author:
- Joseph Ramsey.
-
Constructor Summary
ConstructorsConstructorDescriptionPcStableMax(IndependenceTest independenceTest) Constructs a new PC search using the given independence test as oracle. -
Method Summary
Modifier and TypeMethodDescriptionintgetDepth()longintgetNodes()booleansearch()Runs PC search, returning the output CPDAG.Runs PC search, returning the output CPDAG, over the given nodes.voidsetDepth(int depth) Sets the depth of the search--that is, the maximum number of conditioning nodes for any conditional independence checked.voidsetKnowledge(Knowledge knowledge) Sets the knowledge specification to be used in the search.voidsetMaxPathLength(int maxPathLength) voidsetUseHeuristic(boolean useHeuristic) voidsetVerbose(boolean verbose)
-
Constructor Details
-
PcStableMax
Constructs a new PC search using the given independence test as oracle.- Parameters:
independenceTest- The oracle for conditional independence facts. This does not make a copy of the independence test, for fear of duplicating the data set!
-
-
Method Details
-
getIndependenceTest
- Returns:
- the independence test being used in the search.
-
getKnowledge
- Returns:
- the knowledge specification used in the search. Non-null.
-
setKnowledge
Sets the knowledge specification to be used in the search. May not be null. -
getDepth
public int getDepth()- Returns:
- the current depth of search--that is, the maximum number of conditioning nodes for any conditional independence checked.
-
setDepth
public void setDepth(int depth) Sets the depth of the search--that is, the maximum number of conditioning nodes for any conditional independence checked.- Parameters:
depth- The depth of the search. The default is 1000. A value of -1 may be used to indicate that the depth should be high (1000). A value of Integer.MAX_VALUE may not be used, due to a bug on multi-core machines.
-
search
Runs PC search, returning the output CPDAG.- Specified by:
searchin interfaceGraphSearch
-
search
Runs PC search, returning the output CPDAG, over the given nodes. -
getElapsedTime
public long getElapsedTime()- Returns:
- the elapsed time of the search, in milliseconds.
-
getAdjacencies
-
getNonadjacencies
-
getNodes
-
isVerbose
public boolean isVerbose() -
setVerbose
public void setVerbose(boolean verbose) -
setUseHeuristic
public void setUseHeuristic(boolean useHeuristic) -
setMaxPathLength
public void setMaxPathLength(int maxPathLength) -
getMaxPathLength
public int getMaxPathLength()
-