Class IndTestGin.DistanceCorrTest

java.lang.Object
edu.cmu.tetrad.search.test.IndTestGin.DistanceCorrTest
All Implemented Interfaces:
IndTestGin.UncondIndTest
Enclosing class:
IndTestGin

public static final class IndTestGin.DistanceCorrTest extends Object implements IndTestGin.UncondIndTest
Distance correlation (biased) with optional permutations. Note: analytic p-value here is an approximation; prefer permutations when feasible.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Constructs an instance of the DistanceCorrTest.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the name of the test.
    double
    pValue(double[] x, double[] y)
    Computes the p-value for the given input arrays using a distance correlation test.
    double
    pValuePermuted(double[] x, double[] y, int perms)
    Computes the permutation-based p-value for the distance correlation statistic.

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • DistanceCorrTest

      public DistanceCorrTest()
      Constructs an instance of the DistanceCorrTest. The DistanceCorrTest class provides methods for computing distance correlation-based statistical tests, including the calculation of p-values and permutation-based p-values for input data arrays.
  • Method Details

    • name

      public String name()
      Returns the name of the test.
      Specified by:
      name in interface IndTestGin.UncondIndTest
      Returns:
      the name "dCor"
    • pValue

      public double pValue(double[] x, double[] y)
      Computes the p-value for the given input arrays using a distance correlation test. The method relies on a crude tail approximation for calculating the p-value. The result is constrained to the range [0.0, 1.0].
      Specified by:
      pValue in interface IndTestGin.UncondIndTest
      Parameters:
      x - the first array of data values
      y - the second array of data values
      Returns:
      the computed p-value based on the distance correlation test
    • pValuePermuted

      public double pValuePermuted(double[] x, double[] y, int perms)
      Computes the permutation-based p-value for the distance correlation statistic. The method performs a specified number of permutations of the second data array to compute the proportion of permuted statistics that are greater than or equal to the observed statistic. The result is constrained to the range [0.0, 1.0].
      Parameters:
      x - the first array of data values
      y - the second array of data values
      perms - the number of permutations to use in the computation
      Returns:
      the computed permutation-based p-value