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
    Constructor
    Description
    Default constructor for the PearsonCorrTest class.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the name of the test represented by this class.
    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.

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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

      public String name()
      Returns the name of the test represented by this class.
      Specified by:
      name in interface IndTestGin.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:
      pValue in interface IndTestGin.UncondIndTest
      Parameters:
      x - the first dataset, represented as an array of doubles
      y - the second dataset, represented as an array of doubles
      Returns:
      the p-value for the hypothesis test, clamped to the range [0, 1]