commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pste...@apache.org
Subject [math] Added test confirming correct cumulative probability values for +-INF.
Date Sun, 11 Jan 2015 17:17:27 GMT
Repository: commons-math
Updated Branches:
  refs/heads/master 3a7519fcb -> 61f3eba79


Added test confirming correct cumulative probability values for +-INF.


Project: http://git-wip-us.apache.org/repos/asf/commons-math/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-math/commit/61f3eba7
Tree: http://git-wip-us.apache.org/repos/asf/commons-math/tree/61f3eba7
Diff: http://git-wip-us.apache.org/repos/asf/commons-math/diff/61f3eba7

Branch: refs/heads/master
Commit: 61f3eba79d382c68c27ecb9eb3ad259fc5b75c20
Parents: 3a7519f
Author: Phil Steitz <phil.steitz@gmail.com>
Authored: Sun Jan 11 10:17:13 2015 -0700
Committer: Phil Steitz <phil.steitz@gmail.com>
Committed: Sun Jan 11 10:17:13 2015 -0700

----------------------------------------------------------------------
 .../commons/math3/distribution/TDistributionTest.java   | 12 ++++++++++++
 1 file changed, 12 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-math/blob/61f3eba7/src/test/java/org/apache/commons/math3/distribution/TDistributionTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/math3/distribution/TDistributionTest.java b/src/test/java/org/apache/commons/math3/distribution/TDistributionTest.java
index 1b6e497..2f50b70 100644
--- a/src/test/java/org/apache/commons/math3/distribution/TDistributionTest.java
+++ b/src/test/java/org/apache/commons/math3/distribution/TDistributionTest.java
@@ -100,6 +100,18 @@ public class TDistributionTest extends RealDistributionAbstractTest {
                 new double[] {Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY});
         verifyInverseCumulativeProbabilities();
     }
+    
+    @Test
+    public void testCumulativeProbablilityExtremes() {
+        TDistribution dist;
+        for (int i = 1; i < 11; i++) {
+            dist = new TDistribution(i * 5);
+            Assert.assertEquals(1,
+                dist.cumulativeProbability(Double.POSITIVE_INFINITY), Double.MIN_VALUE);
+            Assert.assertEquals(0,
+                dist.cumulativeProbability(Double.NEGATIVE_INFINITY), Double.MIN_VALUE);
+        }   
+    }
 
     @Test
     public void testDfAccessors() {


Mime
View raw message