Class ConditionalCorrelationIndependence

java.lang.Object
edu.cmu.tetrad.search.ConditionalCorrelationIndependence

public final class ConditionalCorrelationIndependence extends Object
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
  • Constructor Details

    • ConditionalCorrelationIndependence

      public ConditionalCorrelationIndependence(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). 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

      public double isIndependent(Node x, Node y, List<Node> z)
      Returns:
      true iff x is independent of y conditional on z.
    • residuals

      public double[] residuals(Node x, List<Node> z, List<Integer> rows)
      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

      public ConditionalCorrelationIndependence.Kernel getKernelMultiplier()
    • setKernelMultiplier

      public void setKernelMultiplier(ConditionalCorrelationIndependence.Kernel kernelMultiplier)
    • setBasis

      public void setBasis(ConditionalCorrelationIndependence.Basis basis)
    • 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)