Class VcPcFast
java.lang.Object
edu.cmu.tetrad.search.work_in_progress.VcPcFast
- All Implemented Interfaces:
IGraphSearch
Implements a convervative version of PC, in which the Markov condition is assumed but faithfulness is tested
locally.
- Version:
- $Id: $Id
- Author:
- josephramsey (this version).
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enum
An enum of the types of triples that can be found in a graph. -
Constructor Summary
ConstructorsConstructorDescriptionVcPcFast
(IndependenceTest independenceTest) Constructs a CPC algorithm that uses the given independence test as oracle. -
Method Summary
Modifier and TypeMethodDescriptionstatic void
futureNodeVisit
(Graph graph, Node b, LinkedList<Node> path, Set<Node> futureNodes) futureNodeVisit.getAdjacencies.Getter for the fieldambiguousTriples
.getApparentNonadjacencies.Getter for the fieldcolliderTriples
.getDefiniteNonadjacencies.int
getDepth()
Getter for the fielddepth
.long
Getter for the fieldelapsedTime
.getGraph()
The graph that's constructed during the search.Getter for the fieldindependenceTest
.Getter for the fieldknowledge
.Getter for the fieldnoncolliderTriples
.getPopulationTripleType
(Node x, Node y, Node z, IndependenceTest test, int depth, Graph graph, boolean verbose) getPopulationTripleType.boolean
isMeekPreventCycles.search()
search.void
setDepth
(int depth) Sets the maximum number of variables conditioned on in any conditional independence test.void
setFacts
(IndependenceFacts facts) Setter for the fieldfacts
.void
Setter for the fieldgraph
.void
setKnowledge
(Knowledge knowledge) Sets the knowledge specification used in the search.void
setMeekPreventCycles
(boolean meekPreventCycles) Sets to true just in case edges will not be added if they would create cycles.void
setVerbose
(boolean verbose) Setter for the fieldverbose
.
-
Constructor Details
-
VcPcFast
Constructs a CPC algorithm that uses the given independence test as oracle. This does not make a copy of the independence test, for fear of duplicating the data set!- Parameters:
independenceTest
- aIndependenceTest
object
-
-
Method Details
-
futureNodeVisit
public static void futureNodeVisit(Graph graph, Node b, LinkedList<Node> path, Set<Node> futureNodes) futureNodeVisit.
- Parameters:
graph
- aGraph
objectb
- aNode
objectpath
- aLinkedList
objectfutureNodes
- aSet
object
-
isMeekPreventCycles
public boolean isMeekPreventCycles()isMeekPreventCycles.
- Returns:
- true just in case edges will not be added if they would create cycles.
-
setMeekPreventCycles
public void setMeekPreventCycles(boolean meekPreventCycles) Sets to true just in case edges will not be added if they would create cycles.- Parameters:
meekPreventCycles
- a boolean
-
getElapsedTime
public long getElapsedTime()Getter for the field
elapsedTime
.- Returns:
- the elapsed time of search in milliseconds, after
search()
has been run.
-
getKnowledge
Getter for the field
knowledge
.- Returns:
- the knowledge specification used in the search. Non-null.
-
setKnowledge
-
getIndependenceTest
Getter for the field
independenceTest
.- Returns:
- the independence test used in the search, set in the constructor. This is not returning a copy, for fear of duplicating the data set!
-
getDepth
public int getDepth()Getter for the field
depth
.- Returns:
- the depth of the search--that is, the maximum number of variables conditioned on in any conditional independence test.
-
setDepth
public void setDepth(int depth) Sets the maximum number of variables conditioned on in any conditional independence test. If set to -1, the value of 1000 will be used. May not be set to Integer.MAX_VALUE, due to a Java bug on multi-core systems.- Parameters:
depth
- a int
-
getAmbiguousTriples
-
getColliderTriples
-
getNoncolliderTriples
-
getAdjacencies
-
getApparentNonadjacencies
-
getDefiniteNonadjacencies
-
search
search.
- Specified by:
search
in interfaceIGraphSearch
- Returns:
- a
Graph
object - Throws:
InterruptedException
- if any.
-
getPopulationTripleType
public VcPcFast.CpcTripleType getPopulationTripleType(Node x, Node y, Node z, IndependenceTest test, int depth, Graph graph, boolean verbose) throws InterruptedException getPopulationTripleType.
- Parameters:
x
- aNode
objecty
- aNode
objectz
- aNode
objecttest
- aIndependenceTest
objectdepth
- a intgraph
- aGraph
objectverbose
- a boolean- Returns:
- a
VcPcFast.CpcTripleType
object - Throws:
InterruptedException
-
getGraph
-
setGraph
-
setVerbose
public void setVerbose(boolean verbose) Setter for the field
verbose
.- Parameters:
verbose
- a boolean
-
setFacts
Setter for the field
facts
.- Parameters:
facts
- aIndependenceFacts
object
-