Class Cstar

java.lang.Object
edu.cmu.tetrad.search.Cstar

public class Cstar extends Object

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.

Author:
josephramsey
See Also:
  • Constructor Details

  • Method Details

    • cStar

      public static LinkedList<Cstar.Record> cStar(LinkedList<LinkedList<Cstar.Record>> allRecords)
      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.
      path - 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.
      See Also:
    • makeGraph

      public Graph makeGraph(List<Cstar.Record> records)
      Makes a graph of the estimated predictors to the effect.
      Parameters:
      records - The list of records obtained from a method above.
    • setCpdagAlgorithm

      public void setCpdagAlgorithm(Cstar.CpdagAlgorithm cpdagAlgorithm)
      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

      public void setSampleStyle(Cstar.SampleStyle sampleStyle)
      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

      public File getDir()
    • makeTable

      public String makeTable(LinkedList<Cstar.Record> records)
      Returns a text table from the given records