Added another test, fixed reference to target values.

git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/math/trunk@141135 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Phil Steitz 2004-03-21 04:26:54 +00:00
parent f4c6535eca
commit 2adb974fd0
1 changed files with 8 additions and 5 deletions

View File

@ -23,7 +23,7 @@ import org.apache.commons.math.stat.univariate.UnivariateStatisticAbstractTest;
/**
* Test cases for the {@link UnivariateStatistic} class.
* @version $Revision: 1.11 $ $Date: 2004/03/13 20:03:16 $
* @version $Revision: 1.12 $ $Date: 2004/03/21 04:26:54 $
*/
public class PercentileTest extends UnivariateStatisticAbstractTest{
@ -49,7 +49,6 @@ public class PercentileTest extends UnivariateStatisticAbstractTest{
if(stat == null)
stat = new Percentile(95.0);
return stat;
}
@ -57,8 +56,7 @@ public class PercentileTest extends UnivariateStatisticAbstractTest{
* @see org.apache.commons.math.stat.univariate.UnivariateStatisticAbstractTest#expectedValue()
*/
public double expectedValue() {
// TODO: fix this bad calculation in Percentile
return 20.82;
return this.percentile95;
}
public void testHighPercentile(){
@ -86,4 +84,9 @@ public class PercentileTest extends UnivariateStatisticAbstractTest{
Percentile p = new Percentile(90);
assertEquals(95.1981, p.evaluate(d), 1.0e-4);
}
public void test5() {
Percentile percentile = new Percentile(5);
assertEquals(this.percentile5, percentile.evaluate(testArray), getTolerance());
}
}