Package edu.cmu.tetrad.search
Class Cdnod
java.lang.Object
edu.cmu.tetrad.search.Cdnod
- All Implemented Interfaces:
IGraphSearch
The
Cdnod class implements the causal discovery algorithm for detecting changing dependencies with respect to
a change index variable in a dataset.
The algorithm is capable of orienting edges in a graph based on statistical tests, knowledge constraints, and user-defined parameters. It also supports conservative decision-making and constraints on collider orientations.
This class extends the functionality of IGraphSearch and provides methods
for configuring the statistical independence test, working dataset, maximum conditioning depth, and timeout
settings.
Key Features:
- Searches for a graph representing causal structure based on a change index variable.
- Provides support for collider orientation with both conservative logic and maximum p-margin decisions.
- Enables customization of constraints using a
Knowledgeobject. - Supports timeout settings to limit the duration of computations.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classBuilder class for creating instances of the Cdnod class with customized parameters.static enumEnumeration representing different strategies for orienting colliders in causal discovery. -
Method Summary
Modifier and TypeMethodDescriptiongetTest()Gets the test used by the search.search()Runs the search and returns a graph.voidsetDataAndIndex(DataSet dataX, double[] cIndex, String cName) Updates the internal dataset by appending a change index as the last column.voidsetDataWithC(DataSet dataWithC) Sets the dataset to be used in this instance.voidsetTest(IndependenceTest newTest) Sets the test to be used by the search.voidsetTimeoutMs(long timeoutMs) Sets the timeout value in milliseconds for this instance.
-
Method Details
-
search
Description copied from interface:IGraphSearchRuns the search and returns a graph.- Specified by:
searchin interfaceIGraphSearch- Returns:
- The discovered graph.
- Throws:
InterruptedException- if any.
-
getTest
Description copied from interface:IGraphSearchGets the test used by the search.- Specified by:
getTestin interfaceIGraphSearch- Returns:
- The test used by the search.
-
setTest
Description copied from interface:IGraphSearchSets the test to be used by the search. The list of variables of the new proposed test must be equal to the list of variables of the existing test.- Specified by:
setTestin interfaceIGraphSearch- Parameters:
newTest- The test to be used by the search.
-
setDataWithC
Sets the dataset to be used in this instance.- Parameters:
dataWithC- the dataset to be assigned
-
setDataAndIndex
Updates the internal dataset by appending a change index as the last column. This method modifies the data to include an additional column (defined by the provided change index and name) and stores the updated dataset for further processing.- Parameters:
dataX- the original dataset to which the change index will be appendedcIndex- an array representing the change index values to be incorporated into the datasetcName- the name of the new column that will represent the change index
-
setTimeoutMs
public void setTimeoutMs(long timeoutMs) Sets the timeout value in milliseconds for this instance. This value determines the maximum time allowed for certain operations before they are interrupted or terminated.- Parameters:
timeoutMs- the timeout in milliseconds
-