@Test public strictfp void testSingle() { ListStatistics s = new ListStatistics(); s.addValue(42.0D); Assert.assertEquals(1, s.getN()); Assert.assertEquals(42.0D, s.getSum()); Assert.assertEquals(42.0D, s.getMin()); Assert.assertEquals(42.0D, s.getMax()); Assert.assertEquals(42.0D, s.getMean()); Assert.assertEquals(Double.NaN, s.getMeanErrorAt(0.5)); Assert.assertEquals(Double.NaN, s.getVariance()); Assert.assertEquals(Double.NaN, s.getStandardDeviation()); Assert.assertEquals(Double.NaN, s.getConfidenceIntervalAt(0.50)[0]); Assert.assertEquals(Double.NaN, s.getConfidenceIntervalAt(0.50)[1]); Assert.assertEquals(42.0D, s.getPercentile(0)); Assert.assertEquals(42.0D, s.getPercentile(100)); }
@Test public strictfp void testPercentile_100() { assertEquals(96.667, instance.getPercentile(100), 0.002); }
@Test public strictfp void testPercentile_50() { assertEquals(56.460, instance.getPercentile(50), 0.002); }
@Test public strictfp void testPercentile_90() { assertEquals(93.044, instance.getPercentile(90), 0.002); }
@Test public strictfp void testPercentile_00() { assertEquals(2.345, instance.getPercentile(0), 0.002); }