Package edu.cmu.tetrad.search
Class Cstar
java.lang.Object
edu.cmu.tetrad.search.Cstar
Implements the CStaR algorithm (Stekhoven et al., 2012), which finds a CPDAG of that data and then tries all
orientations of the undirected edges about a variable in the CPDAG to estimate a minimum bound on the effect for a
given edge. Some references include the following:
Stekhoven, D. J., Moraes, I., Sveinbjörnsson, G., Hennig, L., Maathuis, M. H., and Bühlmann, P. (2012). Causal stability ranking. Bioinformatics, 28(21), 2819-2823.
Meinshausen, N., and Bühlmann, P. (2010). Stability selection. Journal of the Royal Statistical Society: Series B (Statistical Methodology), 72(4), 417-473.
Colombo, D., and Maathuis, M. H. (2014). Order-independent constraint-based causal structure learning. The Journal of Machine Learning Research, 15(1), 3741-3782.
This class is not configured to respect knowledge of forbidden and required edges.
- Version:
- $Id: $Id
- Author:
- josephramsey
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enum
An enumeration of the options available for determining the CPDAG used for the algorithm.static class
Represents a single record in the returned table for CSTaR.static enum
An enumeration of the methods for selecting samples from the full dataset. -
Constructor Summary
ConstructorsConstructorDescriptionCstar
(IndependenceWrapper test, ScoreWrapper score, Parameters parameters) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionstatic LinkedList
<Cstar.Record> cStar
(LinkedList<LinkedList<Cstar.Record>> allRecords) Returns a list of records for making a CSTaR table.getDir()
getDir.getRecords
(DataSet dataSet, List<Node> possibleCauses, List<Node> possibleEffects, int topBracket, String path) Returns records for a set of variables with expected number of false positives bounded by q.makeGraph
(List<Cstar.Record> records) Makes a graph of the estimated predictors to the effect.makeTable
(LinkedList<Cstar.Record> records) Returns a text table from the given recordsvoid
setCpdagAlgorithm
(Cstar.CpdagAlgorithm cpdagAlgorithm) The CSTaR algorithm can use any CPDAG algorithm; here you can set it.void
setNumSubsamples
(int numSubsamples) Sets the number of subsamples.void
setParallelized
(boolean parallelized) Sets whether the algorithm should be parallelized.void
setSampleStyle
(Cstar.SampleStyle sampleStyle) Sets the sample style.void
setSelectionAlpha
(double selectionAlpha) Sets the selection alpha.void
setVerbose
(boolean verbose) Sets whether verbose output will be printed.
-
Constructor Details
-
Cstar
Constructor.- Parameters:
test
- aIndependenceWrapper
objectscore
- aScoreWrapper
objectparameters
- aParameters
object
-
-
Method Details
-
cStar
Returns a list of records for making a CSTaR table.- Parameters:
allRecords
- the list of all records.- Returns:
- The list for the CSTaR table.
-
setParallelized
public void setParallelized(boolean parallelized) Sets whether the algorithm should be parallelized. Different runs of the algorithms can be run in different threads in parallel.- Parameters:
parallelized
- True, if so.
-
getRecords
public LinkedList<LinkedList<Cstar.Record>> getRecords(DataSet dataSet, List<Node> possibleCauses, List<Node> possibleEffects, int topBracket, String path) Returns records for a set of variables with expected number of false positives bounded by q.- Parameters:
dataSet
- The full datasets to search over.possibleCauses
- A set of variables in the datasets over which to search.possibleEffects
- The effect variables.topBracket
- a intpath
- A path where interim results are to be stored. If null, interim results will not be stored. If the path is specified, then if the process is stopped and restarted, previously computed interim results will be loaded.- Returns:
- a
LinkedList
object - See Also:
-
makeGraph
Makes a graph of the estimated predictors to the effect.- Parameters:
records
- The list of records obtained from a method above.- Returns:
- a
Graph
object
-
setCpdagAlgorithm
The CSTaR algorithm can use any CPDAG algorithm; here you can set it.- Parameters:
cpdagAlgorithm
- The CPDAG algorithm.- See Also:
-
setVerbose
public void setVerbose(boolean verbose) Sets whether verbose output will be printed.- Parameters:
verbose
- True, if so.
-
setSelectionAlpha
public void setSelectionAlpha(double selectionAlpha) Sets the selection alpha.- Parameters:
selectionAlpha
- This alpha.
-
setSampleStyle
Sets the sample style.- Parameters:
sampleStyle
- This style.- See Also:
-
setNumSubsamples
public void setNumSubsamples(int numSubsamples) Sets the number of subsamples.- Parameters:
numSubsamples
- This number.
-
getDir
-
makeTable
Returns a text table from the given records- Parameters:
records
- aLinkedList
object- Returns:
- a
String
object
-