Package edu.cmu.tetrad.search
Class TimeSeriesLagSearch
java.lang.Object
edu.cmu.tetrad.search.TimeSeriesLagSearch
- All Implemented Interfaces:
GraphSearch
Implements a convervative version of PC, in which the Markov condition is assumed but faithfulness is tested
locally.
- Author:
- Joseph Ramsey (this version).
-
Constructor Summary
ConstructorsConstructorDescriptionTimeSeriesLagSearch
(IndependenceTest independenceTest) Constructs a CPC algorithm that uses the given independence test as oracle. -
Method Summary
Modifier and TypeMethodDescriptionint
getDepth()
long
boolean
orientationForGraph
(Dag trueGraph) Orients the given graph using CPC orientation with the conditional independence test provided in the constructor.search()
Runs PC starting with a fully connected graph over all of the variables in the domain of the independence test.Runs PC on just the given variable, all of which must be in the domain of the independence test.void
setAggressivelyPreventCycles
(boolean aggressivelyPreventCycles) Sets to true just in case edges will not be added if they would create cycles.void
setKnowledge
(Knowledge knowledge) Sets the knowledge specification used in the search.
-
Constructor Details
-
TimeSeriesLagSearch
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!
-
-
Method Details
-
isAggressivelyPreventCycles
public boolean isAggressivelyPreventCycles()- Returns:
- true just in case edges will not be added if they would create cycles.
-
setAggressivelyPreventCycles
public void setAggressivelyPreventCycles(boolean aggressivelyPreventCycles) Sets to true just in case edges will not be added if they would create cycles. -
getElapsedTime
public long getElapsedTime()- Returns:
- the elapsed time of search in milliseconds, after
search()
has been run.
-
getKnowledge
- Returns:
- the knowledge specification used in the search. Non-null.
-
setKnowledge
Sets the knowledge specification used in the search. Non-null. -
getIndependenceTest
- 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()- Returns:
- the depth of the search--that is, the maximum number of variables conditioned on in any conditional independence test.
-
getAmbiguousTriples
- Returns:
- the set of ambiguous triples found during the most recent run of the algorithm. Non-null after a call to
search()
.
-
getColliderTriples
- Returns:
- the set of collider triples found during the most recent run of the algorithm. Non-null after a call to
search()
.
-
getNoncolliderTriples
- Returns:
- the set of noncollider triples found during the most recent run of the algorithm. Non-null after a call
to
search()
.
-
getAllTriples
- Returns:
- the set of all triples found during the most recent run of the algorithm. Non-null after a call to
search()
.
-
search
Runs PC starting with a fully connected graph over all of the variables in the domain of the independence test. See PC for caveats. The number of possible cycles and bidirected edges is far less with CPC than with PC.- Specified by:
search
in interfaceGraphSearch
-
search
Runs PC on just the given variable, all of which must be in the domain of the independence test. See PC for caveats. The number of possible cycles and bidirected edges is far less with CPC than with PC. -
orientationForGraph
Orients the given graph using CPC orientation with the conditional independence test provided in the constructor.
-