Package edu.cmu.tetrad.search
Class Pcmci
java.lang.Object
edu.cmu.tetrad.search.Pcmci
- All Implemented Interfaces:
IGraphSearch
PCMCI (Runge et al.) — minimal, time-series implementation with lagged edges only (τ≥1).
Pipeline:
- Build lagged variables up to
maxLag. - Parent pre-selection per node
V: PC1-like elimination using only the strict past ofV. - MCI step: keep
Xt-τ →Yt iffX¬⊥Y|Pa(Y)\{X} ∪Pa(X). - Add directed edges
Xt-τ →Yt; optionally collapse to base-time nodes.
Notes:
IndependenceTestis user-supplied (e.g., FisherZ, etc.).Knowledgeconstraints are enforced for allowed/forbidden arcs (including tiering).- This version orients only τ>0 (no instantaneous τ=0); add later for PCMCI+.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classBuilder class for constructing instances of the Pcmci class. -
Method Summary
Modifier and TypeMethodDescriptiongetTest()Retrieves the current independence test used by the PCMCI algorithm.search()Executes the PCMCI (Peter and Clark Momentary Conditional Independence) algorithm to discover causal relationships in time series data.voidsetTest(IndependenceTest newTest) Sets a new independence test for the PCMCI algorithm.
-
Method Details
-
search
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:
searchin interfaceIGraphSearch- 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
Retrieves the current independence test used by the PCMCI algorithm.- Specified by:
getTestin interfaceIGraphSearch- Returns:
- The
IndependenceTestinstance currently associated with this class.
-
setTest
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:
setTestin interfaceIGraphSearch- Parameters:
newTest- TheIndependenceTestinstance 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.
-