org.apache.commons.math3.stat.correlation
Class PearsonsCorrelationTest

java.lang.Object
  extended by org.apache.commons.math3.stat.correlation.PearsonsCorrelationTest
Direct Known Subclasses:
SpearmansRankCorrelationTest

public class PearsonsCorrelationTest
extends Object


Field Summary
protected  double[] longleyData
           
protected  double[] swissData
           
 
Constructor Summary
PearsonsCorrelationTest()
           
 
Method Summary
protected  RealMatrix createLowerTriangularRealMatrix(double[] data, int dimension)
           
protected  RealMatrix createRealMatrix(double[] data, int nRows, int nCols)
           
protected  void fillUpper(RealMatrix matrix, double diagonalValue)
           
 void testConsistency()
           
 void testConstant()
          Constant column
 void testCovarianceConsistency()
          Verify that creating correlation from covariance gives same results as direct computation from the original matrix
 void testInsufficientData()
          Insufficient data
 void testLongly()
          Test Longley dataset against R.
 void testPValueNearZero()
          Test p-value near 0.
 void testStdErrorConsistency()
          Verify that direct t-tests using standard error estimates are consistent with reported p-values
 void testSwissFertility()
          Test R Swiss fertility dataset against R.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

longleyData

protected final double[] longleyData

swissData

protected final double[] swissData
Constructor Detail

PearsonsCorrelationTest

public PearsonsCorrelationTest()
Method Detail

testLongly

public void testLongly()
Test Longley dataset against R.


testSwissFertility

public void testSwissFertility()
Test R Swiss fertility dataset against R.


testPValueNearZero

public void testPValueNearZero()
Test p-value near 0. JIRA: MATH-371


testConstant

public void testConstant()
Constant column


testInsufficientData

public void testInsufficientData()
Insufficient data


testStdErrorConsistency

public void testStdErrorConsistency()
Verify that direct t-tests using standard error estimates are consistent with reported p-values


testCovarianceConsistency

public void testCovarianceConsistency()
Verify that creating correlation from covariance gives same results as direct computation from the original matrix


testConsistency

public void testConsistency()

createRealMatrix

protected RealMatrix createRealMatrix(double[] data,
                                      int nRows,
                                      int nCols)

createLowerTriangularRealMatrix

protected RealMatrix createLowerTriangularRealMatrix(double[] data,
                                                     int dimension)

fillUpper

protected void fillUpper(RealMatrix matrix,
                         double diagonalValue)


Copyright © 2003-2013 The Apache Software Foundation. All Rights Reserved.