java.lang.Object
edu.cmu.tetrad.algcomparison.algorithm.oracle.cpdag.Pcmci
All Implemented Interfaces:
Algorithm, HasKnowledge, HasParameters, TakesIndependenceWrapper, TetradSerializable, Serializable

PCMCI wrapper for algcomparison. NOTE: Knowledge comes from TsUtils.createLagData(...) and is used inside Pcmci.
See Also:
  • Constructor Details

    • Pcmci

      public Pcmci()
      Default constructor for the Pcmci class. Initializes an instance of Pcmci without any dependencies or parameters.
    • Pcmci

      public Pcmci(IndependenceWrapper test)
      Constructs an instance of the Pcmci class with a specified independence test.
      Parameters:
      test - The IndependenceWrapper instance representing a specific independence test implementation to be used in PCMCI algorithm.
  • Method Details

    • search

      public Graph search(DataModel dataModel, Parameters parameters) throws InterruptedException
      Executes the PCMCI (Peter and Clark Momentary Conditional Independence) causal discovery algorithm on a given data model using specified parameters. The method relies on the assumption that the input data model is a DataSet and includes handling of lagged datasets, parameterized independence tests, and configurable search options.
      Specified by:
      search in interface Algorithm
      Parameters:
      dataModel - The input data model to perform the PCMCI search on. Must be an instance of DataSet. If the provided data model is not of this type, an IllegalArgumentException is thrown.
      parameters - The set of parameters to configure the PCMCI search. These include: - TIME_LAG (default: 1): Maximum time lag for lagged variables. - DEPTH (default: 3): Maximum size of conditioning sets in conditional independence tests. - ALPHA (default: 0.05): Significance level for independence tests. - VERBOSE (default: false): Toggle for detailed output logs.
      Returns:
      A Graph representing the causal structure learned from the input data model.
      Throws:
      InterruptedException - If the thread executing the method is interrupted during processing.
    • getComparisonGraph

      public Graph getComparisonGraph(Graph graph)
      Generates a comparison causal graph derived from the input graph by converting it to a completed partially directed acyclic graph (CPDAG).
      Specified by:
      getComparisonGraph in interface Algorithm
      Parameters:
      graph - The input Graph that represents the initial structure from which the comparison graph is derived.
      Returns:
      A Graph that represents the CPDAG obtained from the input graph.
    • getDescription

      public String getDescription()
      Provides a description for the PCMCI algorithm, including the configured independence test, if applicable.
      Specified by:
      getDescription in interface Algorithm
      Returns:
      A string describing the PCMCI algorithm and the independence test being used. If no test is provided, the description will indicate a "configured test".
    • getDataType

      public DataType getDataType()
      Retrieves the data type of the dataset required for the PCMCI algorithm. This can be continuous, discrete, mixed, or other specific types defined in DataType.
      Specified by:
      getDataType in interface Algorithm
      Returns:
      The DataType instance representing the type required or handled by the PCMCI algorithm, as provided by the associated IndependenceWrapper.
    • getParameters

      public List<String> getParameters()
      Retrieves a list of parameter names used to configure the PCMCI algorithm. The parameters include:
      Specified by:
      getParameters in interface HasParameters
      Returns:
      A list of parameter names as strings that are applicable for the PCMCI algorithm.
    • getIndependenceWrapper

      public IndependenceWrapper getIndependenceWrapper()
      Retrieves the current instance of IndependenceWrapper associated with this object.
      Specified by:
      getIndependenceWrapper in interface TakesIndependenceWrapper
      Returns:
      The IndependenceWrapper instance representing the current independence test implementation used in the PCMCI algorithm.
    • setIndependenceWrapper

      public void setIndependenceWrapper(IndependenceWrapper test)
      Sets the IndependenceWrapper instance to be used for the PCMCI algorithm.
      Specified by:
      setIndependenceWrapper in interface TakesIndependenceWrapper
      Parameters:
      test - The IndependenceWrapper instance representing a specific implementation of an independence test to be associated with this object.
    • getKnowledge

      public Knowledge getKnowledge()
      Description copied from interface: HasKnowledge
      Returns a knowledge object.
      Specified by:
      getKnowledge in interface HasKnowledge
      Returns:
      a knowledge object.
    • setKnowledge

      public void setKnowledge(Knowledge knowledge)
      Description copied from interface: HasKnowledge
      Sets a knowledge object.
      Specified by:
      setKnowledge in interface HasKnowledge
      Parameters:
      knowledge - a knowledge object.