commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pste...@apache.org
Subject cvs commit: jakarta-commons/math/src/test/org/apache/commons/math/stat/univariate/rank PercentileTest.java
Date Sun, 21 Mar 2004 04:26:54 GMT
psteitz     2004/03/20 20:26:54

  Modified:    math/src/test/org/apache/commons/math/stat/univariate/rank
                        PercentileTest.java
  Log:
  Added another test, fixed reference to target values.
  
  Revision  Changes    Path
  1.12      +8 -5      jakarta-commons/math/src/test/org/apache/commons/math/stat/univariate/rank/PercentileTest.java
  
  Index: PercentileTest.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/math/src/test/org/apache/commons/math/stat/univariate/rank/PercentileTest.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- PercentileTest.java	13 Mar 2004 20:03:16 -0000	1.11
  +++ PercentileTest.java	21 Mar 2004 04:26:54 -0000	1.12
  @@ -48,8 +48,7 @@
       public UnivariateStatistic getUnivariateStatistic() {
          
           if(stat == null)
  -            stat = new Percentile(95.0);
  -            
  +            stat = new Percentile(95.0);         
           return stat;
       }
   
  @@ -57,8 +56,7 @@
        * @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(){
  @@ -85,5 +83,10 @@
           };
           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());
       }
   }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message