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

This commit is contained in:
Phil Steitz 2015-01-11 10:17:13 -07:00
parent 3a7519fcb1
commit 61f3eba79d
1 changed files with 12 additions and 0 deletions

View File

@ -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() {