Class Pcmci

java.lang.Object
edu.cmu.tetrad.search.Pcmci
All Implemented Interfaces:
IGraphSearch

public final class Pcmci extends Object implements IGraphSearch

PCMCI (Runge et al.) — minimal, time-series implementation with lagged edges only (τ≥1).

Pipeline:

  1. Build lagged variables up to maxLag.
  2. Parent pre-selection per node V: PC1-like elimination using only the strict past of V.
  3. MCI step: keep Xt-τYt iff X ¬⊥ Y  |  Pa(Y)\{X} ∪ Pa(X).
  4. Add directed edges Xt-τYt; optionally collapse to base-time nodes.

Notes:

  • IndependenceTest is user-supplied (e.g., FisherZ, etc.).
  • Knowledge constraints are enforced for allowed/forbidden arcs (including tiering).
  • This version orients only τ>0 (no instantaneous τ=0); add later for PCMCI+.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static final class 
    Builder class for constructing instances of the Pcmci class.
  • Method Summary

    Modifier and Type
    Method
    Description
    Retrieves the current independence test used by the PCMCI algorithm.
    Executes the PCMCI (Peter and Clark Momentary Conditional Independence) algorithm to discover causal relationships in time series data.
    void
    Sets a new independence test for the PCMCI algorithm.

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • search

      public Graph search() throws InterruptedException
      Executes the PCMCI (Peter and Clark Momentary Conditional Independence) algorithm to discover causal relationships in time series data. The method constructs a lagged dataset up to the specified maximum lag, performs parent preselection, confirms causal relationships using conditional independence tests, and creates a directed graph representing the causal structure.
      Specified by:
      search in interface IGraphSearch
      Returns:
      A directed graph where nodes represent time-lagged variables or base-time variables (depending on the value of `collapseToLag0`) and directed edges represent causal relationships derived using the PCMCI algorithm.
      Throws:
      InterruptedException - If the process is interrupted during computation.
    • getTest

      public IndependenceTest getTest()
      Retrieves the current independence test used by the PCMCI algorithm.
      Specified by:
      getTest in interface IGraphSearch
      Returns:
      The IndependenceTest instance currently associated with this class.
    • setTest

      public void setTest(IndependenceTest newTest)
      Sets a new independence test for the PCMCI algorithm. The variables used by the new test must match the variables of the current test to ensure consistency in the analysis. Switching tests is also restricted after the PCMCI object has been built.
      Specified by:
      setTest in interface IGraphSearch
      Parameters:
      newTest - The IndependenceTest instance to set as the new independence test.
      Throws:
      IllegalArgumentException - If the variables in the new independence test do not match the variables in the current test.
      IllegalStateException - If attempting to switch the independence test after the PCMCI object has been built.