Package edu.cmu.tetrad.search.test
Class IndTestGin.PearsonCorrTest
java.lang.Object
edu.cmu.tetrad.search.test.IndTestGin.PearsonCorrTest
- All Implemented Interfaces:
IndTestGin.UncondIndTest
- Enclosing class:
IndTestGin
public static final class IndTestGin.PearsonCorrTest
extends Object
implements IndTestGin.UncondIndTest
Fast Pearson correlation t-test (linear).
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
PearsonCorrTest
public PearsonCorrTest()Default constructor for the PearsonCorrTest class. This class implements a statistical test for assessing the null hypothesis that two datasets are uncorrelated using the Pearson correlation coefficient.
-
-
Method Details
-
name
Returns the name of the test represented by this class.- Specified by:
namein interfaceIndTestGin.UncondIndTest- Returns:
- the name of the test, which is "Pearson-t".
-
pValue
public double pValue(double[] x, double[] y) Computes the p-value for testing the null hypothesis that two datasets are uncorrelated, based on the Pearson correlation coefficient. The p-value is derived from the t-distribution with the given sample sizes.- Specified by:
pValuein interfaceIndTestGin.UncondIndTest- Parameters:
x- the first dataset, represented as an array of doublesy- the second dataset, represented as an array of doubles- Returns:
- the p-value for the hypothesis test, clamped to the range [0, 1]
-