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/inference TTestTest.java
Date Mon, 24 May 2004 05:34:30 GMT
psteitz     2004/05/23 22:34:30

  Modified:    math/src/test/org/apache/commons/math/stat/inference
                        TTestTest.java
  Log:
  Added tests for paired t-tests.
  PR #29049
  
  Revision  Changes    Path
  1.3       +13 -1     jakarta-commons/math/src/test/org/apache/commons/math/stat/inference/TTestTest.java
  
  Index: TTestTest.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/math/src/test/org/apache/commons/math/stat/inference/TTestTest.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- TTestTest.java	23 May 2004 05:06:20 -0000	1.2
  +++ TTestTest.java	24 May 2004 05:34:30 -0000	1.3
  @@ -228,8 +228,20 @@
       public void testSmallSamples() throws Exception {
           double[] sample1 = {1d, 3d};
           double[] sample2 = {4d, 5d};        
  +        
           // Target values computed using R, version 1.8.1 (linux version)
           assertEquals(-2.2361, testStatistic.t(sample1, sample2), 1E-4);
           assertEquals(0.1987, testStatistic.tTest(sample1, sample2), 1E-4);
  +    }
  +    
  +    public void testPaired() throws Exception {
  +        double[] sample1 = {1d, 3d, 5d, 7d};
  +        double[] sample2 = {0d, 6d, 11d, 2d};
  +        double[] sample3 = {0d, 2d};
  +        
  +        // Target values computed using R, version 1.8.1 (linux version)
  +        assertEquals(-0.3133, testStatistic.pairedT(sample1, sample2), 1E-4);
  +        assertEquals(0.774544295819, testStatistic.pairedTTest(sample1, sample2), 1E-10);
  +        
       }
   }
  
  
  

---------------------------------------------------------------------
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