Package edu.cmu.tetrad.search
Class ConditionalCorrelationIndependence
java.lang.Object
edu.cmu.tetrad.search.ConditionalCorrelationIndependence
Checks conditional independence of variable in a continuous data set using Daudin's method. See
Ramsey, J. D. (2014). A scalable conditional independence test for nonlinear, non-Gaussian data. arXiv preprint arXiv:1401.5031.
This is corrected using Lemma 2, condition 4 of
Zhang, K., Peters, J., Janzing, D., and Schölkopf, B. (2012). Kernel-based conditional independence test and application in causal discovery. arXiv preprint arXiv:1202.3775.
This all follows the original Daudin paper, which is this:
Daudin, J. J. (1980). Partial association measures and a application to qualitative regression. Biometrika, 67(3), 581-590.
We use Nadaraya-Watson kernel regression, though we further restrict the sample size to nearby points.
- Author:
- Joseph Ramsey
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enum
static enum
-
Constructor Summary
ConstructorsConstructorDescriptionConditionalCorrelationIndependence
(DataSet dataSet, double alpha) Constructs a new Independence test which checks independence facts based on the correlation data implied by the given data set (must be continuous). -
Method Summary
Modifier and TypeMethodDescriptiondouble
getAlpha()
int
Number of functions to use in (truncated) basisdouble
double
getPValue
(double score) double
getScore()
double
getWidth()
double
isIndependent
(Node x, Node y, List<Node> z) double[]
Calculates the residuals of x regressed nonparametrically onto z.void
setAlpha
(double alpha) void
void
setKernelMultiplier
(ConditionalCorrelationIndependence.Kernel kernelMultiplier) void
setKernelRegressionSampleSize
(int kernelRegressionSapleSize) void
setNumFunctions
(int numFunctions) void
setWidth
(double width)
-
Constructor Details
-
ConditionalCorrelationIndependence
Constructs a new Independence test which checks independence facts based on the correlation data implied by the given data set (must be continuous). The given significance level is used.- Parameters:
dataSet
- A data set containing only continuous columns.alpha
- The alpha level of the test.
-
-
Method Details
-
isIndependent
- Returns:
- true iff x is independent of y conditional on z.
-
residuals
Calculates the residuals of x regressed nonparametrically onto z. Left public so it can be accessed separately.- Returns:
- a double[2][] array. The first double[] array contains the residuals for x and the second double[] array contains the resituls for y.
-
getNumFunctions
public int getNumFunctions()Number of functions to use in (truncated) basis -
setNumFunctions
public void setNumFunctions(int numFunctions) -
getKernelMultiplier
-
setKernelMultiplier
-
setBasis
-
getWidth
public double getWidth() -
setWidth
public void setWidth(double width) -
getPValue
public double getPValue() -
getPValue
public double getPValue(double score) -
getScore
public double getScore()- Returns:
- the minimal scores value calculated by the method for the most recent independence check.
-
setAlpha
public void setAlpha(double alpha) -
getAlpha
public double getAlpha() -
setKernelRegressionSampleSize
public void setKernelRegressionSampleSize(int kernelRegressionSapleSize)
-