You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by ps...@apache.org on 2013/11/09 21:31:52 UTC

svn commit: r1540392 - /commons/proper/math/trunk/src/test/java/org/apache/commons/math3/stat/correlation/PearsonsCorrelationTest.java

Author: psteitz
Date: Sat Nov  9 20:31:52 2013
New Revision: 1540392

URL: http://svn.apache.org/r1540392
Log:
Added test to verify that zero variance in either array leads to NaN.

Modified:
    commons/proper/math/trunk/src/test/java/org/apache/commons/math3/stat/correlation/PearsonsCorrelationTest.java

Modified: commons/proper/math/trunk/src/test/java/org/apache/commons/math3/stat/correlation/PearsonsCorrelationTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/java/org/apache/commons/math3/stat/correlation/PearsonsCorrelationTest.java?rev=1540392&r1=1540391&r2=1540392&view=diff
==============================================================================
--- commons/proper/math/trunk/src/test/java/org/apache/commons/math3/stat/correlation/PearsonsCorrelationTest.java (original)
+++ commons/proper/math/trunk/src/test/java/org/apache/commons/math3/stat/correlation/PearsonsCorrelationTest.java Sat Nov  9 20:31:52 2013
@@ -194,6 +194,7 @@ public class PearsonsCorrelationTest {
         double[] noVariance = new double[] {1, 1, 1, 1};
         double[] values = new double[] {1, 2, 3, 4};
         Assert.assertTrue(Double.isNaN(new PearsonsCorrelation().correlation(noVariance, values)));
+        Assert.assertTrue(Double.isNaN(new PearsonsCorrelation().correlation(values, noVariance)));
     }