Package edu.cmu.tetrad.search.test
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 -
Method Summary
Modifier and TypeMethodDescriptionname()Returns the name of the test.doublepValue(double[] x, double[] y) Computes the p-value for the given input arrays using a distance correlation test.doublepValuePermuted(double[] x, double[] y, int perms) Computes the permutation-based p-value for the distance correlation statistic.
-
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
Returns the name of the test.- Specified by:
namein interfaceIndTestGin.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:
pValuein interfaceIndTestGin.UncondIndTest- Parameters:
x- the first array of data valuesy- 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 valuesy- the second array of data valuesperms- the number of permutations to use in the computation- Returns:
- the computed permutation-based p-value
-