Class IndTestConditionalCorrelation

java.lang.Object
edu.cmu.tetrad.search.test.IndTestConditionalCorrelation
All Implemented Interfaces:
IndependenceTest, RowsSettable

public final class IndTestConditionalCorrelation extends Object implements IndependenceTest, RowsSettable
Checks conditional independence of variable in a continuous data set using a conditional correlation test for the nonlinear nonGaussian with the additive error case. This is for additive (but otherwise general) models.
Version:
$Id: $Id
Author:
josephramsey
  • Constructor Details

    • IndTestConditionalCorrelation

      public IndTestConditionalCorrelation(DataSet dataSet, double alpha, double scalingFactor, int basisType, double basisScale, int numFunctions)
      Constructs a new IndTestConditionalCorrelation to check independence based on conditional correlations derived from the given continuous data set. The test uses the specified significance level and allows customization of basis settings and a scaling factor.
      Parameters:
      dataSet - The continuous data set for performing independence tests.
      alpha - The significance level for the test (must be between 0 and 1 inclusive).
      scalingFactor - The scaling factor applied in the independence test computations.
      basisType - The type of basis functions used in the computations.
      basisScale - The scale of the basis functions applied in computations.
      numFunctions - The number of orthogonal functions used for the calculations.
      Throws:
      IllegalArgumentException - if the data set is not continuous.
      IllegalArgumentException - if the significance level (alpha) is not in the range [0, 1].
  • Method Details

    • indTestSubset

      public IndependenceTest indTestSubset(List<Node> vars)
      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.
      Specified by:
      indTestSubset in interface IndependenceTest
      Parameters:
      vars - The sublist of variables.
      Returns:
      a IndependenceTest object
    • checkIndependence

      public IndependenceResult checkIndependence(Node x, Node y, Set<Node> z)
      Checks the independence of x _||_ y | z
      Specified by:
      checkIndependence in interface IndependenceTest
      Parameters:
      x - a Node object
      y - a Node object
      z - a Set object
      Returns:
      a IndependenceResult object
      See Also:
    • getAlpha

      public double getAlpha()
      Returns the model significance level.
      Specified by:
      getAlpha in interface IndependenceTest
      Returns:
      This level.
    • setAlpha

      public void setAlpha(double alpha)
      Sets the significance level for the test. The significance level (alpha) must be a value between 0 and 1, inclusive.
      Specified by:
      setAlpha in interface IndependenceTest
      Parameters:
      alpha - The new significance level to be set for the test. This value determines the threshold for statistical significance in the independence test computations.
    • getVariables

      public List<Node> getVariables()
      Returns the list of variables over which this independence checker is capable of determining independence relations-- that is, all the variables in the given graph or the given data set.
      Specified by:
      getVariables in interface IndependenceTest
      Returns:
      This list.
    • getData

      public DataSet getData()
      Returns the data set being analyzed.
      Specified by:
      getData in interface IndependenceTest
      Returns:
      This dataset.
    • toString

      public String toString()
      Returns a string representation of this test.
      Specified by:
      toString in interface IndependenceTest
      Overrides:
      toString in class Object
      Returns:
      This string.
    • isVerbose

      public boolean isVerbose()
      Returns true if verbose output should be printed.
      Specified by:
      isVerbose in interface IndependenceTest
      Returns:
      True if the case.
    • setVerbose

      public void setVerbose(boolean verbose)
      Sets whether verbose output should be printed.
      Specified by:
      setVerbose in interface IndependenceTest
      Parameters:
      verbose - True, if so.
    • getRows

      public List<Integer> getRows()
      Returns the number of orthogonal functions used to do the calculations. The sets used are the polynomial basis functions, x, x^2, x^3, etc. This choice is made to allow for more flexible domains of the functions after standardization.
      Specified by:
      getRows in interface RowsSettable
      Returns:
      This number.
    • setRows

      public void setRows(List<Integer> rows)
      Sets the rows to use for the test.
      Specified by:
      setRows in interface RowsSettable
      Parameters:
      rows - The rows.
    • getMissingValueSupport

      public MissingValueSupport getMissingValueSupport()
      Declares what this test can do, natively, with data containing missing values. The default is MissingValueSupport.NONE, meaning that missingness must be handled upstream (e.g., by imputation, or by supplying an EM-estimated covariance matrix if the test consumes one); tests that handle missing values themselves should override this.

      TESTWISE: each test is evaluated on the (active) rows complete on x, y, and z; this has always been the behavior of this test, and is now declared.

      Specified by:
      getMissingValueSupport in interface IndependenceTest
      Returns:
      This support level.