Class Pcmci
java.lang.Object
edu.cmu.tetrad.algcomparison.algorithm.oracle.cpdag.Pcmci
- All Implemented Interfaces:
Algorithm,HasKnowledge,HasParameters,TakesIndependenceWrapper,TetradSerializable,Serializable
@Algorithm(name="PCMCI",
command="pcmci",
algoType=forbid_latent_common_causes)
@Experimental
public class Pcmci
extends Object
implements Algorithm, TakesIndependenceWrapper, HasKnowledge
PCMCI wrapper for algcomparison. NOTE: Knowledge comes from TsUtils.createLagData(...) and is used inside Pcmci.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionPcmci()Default constructor for the Pcmci class.Pcmci(IndependenceWrapper test) Constructs an instance of the Pcmci class with a specified independence test. -
Method Summary
Modifier and TypeMethodDescriptiongetComparisonGraph(Graph graph) Generates a comparison causal graph derived from the input graph by converting it to a completed partially directed acyclic graph (CPDAG).Retrieves the data type of the dataset required for the PCMCI algorithm.Provides a description for the PCMCI algorithm, including the configured independence test, if applicable.Retrieves the current instance ofIndependenceWrapperassociated with this object.Returns a knowledge object.Retrieves a list of parameter names used to configure the PCMCI algorithm.search(DataModel dataModel, Parameters parameters) Executes the PCMCI (Peter and Clark Momentary Conditional Independence) causal discovery algorithm on a given data model using specified parameters.voidSets theIndependenceWrapperinstance to be used for the PCMCI algorithm.voidsetKnowledge(Knowledge knowledge) Sets a knowledge object.
-
Constructor Details
-
Pcmci
public Pcmci()Default constructor for the Pcmci class. Initializes an instance of Pcmci without any dependencies or parameters. -
Pcmci
Constructs an instance of the Pcmci class with a specified independence test.- Parameters:
test- TheIndependenceWrapperinstance representing a specific independence test implementation to be used in PCMCI algorithm.
-
-
Method Details
-
search
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 aDataSetand includes handling of lagged datasets, parameterized independence tests, and configurable search options.- Specified by:
searchin interfaceAlgorithm- Parameters:
dataModel- The input data model to perform the PCMCI search on. Must be an instance ofDataSet. If the provided data model is not of this type, anIllegalArgumentExceptionis 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
Graphrepresenting the causal structure learned from the input data model. - Throws:
InterruptedException- If the thread executing the method is interrupted during processing.
-
getComparisonGraph
Generates a comparison causal graph derived from the input graph by converting it to a completed partially directed acyclic graph (CPDAG).- Specified by:
getComparisonGraphin interfaceAlgorithm- Parameters:
graph- The inputGraphthat represents the initial structure from which the comparison graph is derived.- Returns:
- A
Graphthat represents the CPDAG obtained from the input graph.
-
getDescription
Provides a description for the PCMCI algorithm, including the configured independence test, if applicable.- Specified by:
getDescriptionin interfaceAlgorithm- 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
Retrieves the data type of the dataset required for the PCMCI algorithm. This can be continuous, discrete, mixed, or other specific types defined inDataType.- Specified by:
getDataTypein interfaceAlgorithm- Returns:
- The
DataTypeinstance representing the type required or handled by the PCMCI algorithm, as provided by the associatedIndependenceWrapper.
-
getParameters
Retrieves a list of parameter names used to configure the PCMCI algorithm. The parameters include:- Specified by:
getParametersin interfaceHasParameters- Returns:
- A list of parameter names as strings that are applicable for the PCMCI algorithm.
-
getIndependenceWrapper
Retrieves the current instance ofIndependenceWrapperassociated with this object.- Specified by:
getIndependenceWrapperin interfaceTakesIndependenceWrapper- Returns:
- The
IndependenceWrapperinstance representing the current independence test implementation used in the PCMCI algorithm.
-
setIndependenceWrapper
Sets theIndependenceWrapperinstance to be used for the PCMCI algorithm.- Specified by:
setIndependenceWrapperin interfaceTakesIndependenceWrapper- Parameters:
test- TheIndependenceWrapperinstance representing a specific implementation of an independence test to be associated with this object.
-
getKnowledge
Description copied from interface:HasKnowledgeReturns a knowledge object.- Specified by:
getKnowledgein interfaceHasKnowledge- Returns:
- a knowledge object.
-
setKnowledge
Description copied from interface:HasKnowledgeSets a knowledge object.- Specified by:
setKnowledgein interfaceHasKnowledge- Parameters:
knowledge- a knowledge object.
-