Added test to verify that zero variance in either array leads to NaN.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1540392 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
d252a811a2
commit
eca87abcee
|
@ -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)));
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue