You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by er...@apache.org on 2020/04/12 11:26:41 UTC

[commons-statistics] branch master updated (d2d2a03 -> cbc1059)

This is an automated email from the ASF dual-hosted git repository.

erans pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/commons-statistics.git.


    from d2d2a03  Standardize on American English spelling of 'behavior'.
     new d26f43c  Upgrade CP.
     new e75f4e7  Split unit test cases.
     new 3d6d665  Limit dependency to "test" scope.
     new 22ade0f  Upgrade to version 1.3 "Commons RNG".
     new cbc1059  STATISTICS-23: Order of arguments in "GammaDistribution" sampler.

The 5 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../statistics/distribution/GammaDistribution.java |  2 +-
 .../distribution/NormalDistributionTest.java       | 37 ++++++++++++++++------
 pom.xml                                            |  5 +--
 3 files changed, 31 insertions(+), 13 deletions(-)


[commons-statistics] 04/05: Upgrade to version 1.3 "Commons RNG".

Posted by er...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

erans pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-statistics.git

commit 22ade0f5963c526bb92ab861c469d014566606ca
Author: Gilles Sadowski <gi...@gmail.com>
AuthorDate: Sun Apr 12 13:21:14 2020 +0200

    Upgrade to version 1.3 "Commons RNG".
    
    This entails a unit test failure (cf. JIRA: STATISTICS-23).
---
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index d67d29c..00b7835 100644
--- a/pom.xml
+++ b/pom.xml
@@ -120,7 +120,7 @@
         Temporary workaround?
     -->
     <commons.release.name>commons-statistics-${project.version}</commons.release.name>
-    <statistics.commons.rng.version>1.2</statistics.commons.rng.version>
+    <statistics.commons.rng.version>1.3</statistics.commons.rng.version>
     <statistics.commons.numbers.version>1.0-SNAPSHOT</statistics.commons.numbers.version> <!-- XXX -->
     <statistics.commons.math3.version>3.6.1</statistics.commons.math3.version>
   </properties>


[commons-statistics] 02/05: Split unit test cases.

Posted by er...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

erans pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-statistics.git

commit e75f4e761feef28cf0f296d11c55de687a0f5047
Author: Gilles Sadowski <gi...@gmail.com>
AuthorDate: Sun Apr 12 12:35:10 2020 +0200

    Split unit test cases.
    
    Removed outdated "TODO" comment.
---
 .../distribution/NormalDistributionTest.java       | 37 ++++++++++++++++------
 1 file changed, 27 insertions(+), 10 deletions(-)

diff --git a/commons-statistics-distribution/src/test/java/org/apache/commons/statistics/distribution/NormalDistributionTest.java b/commons-statistics-distribution/src/test/java/org/apache/commons/statistics/distribution/NormalDistributionTest.java
index b146c21..ce3737a 100644
--- a/commons-statistics-distribution/src/test/java/org/apache/commons/statistics/distribution/NormalDistributionTest.java
+++ b/commons-statistics-distribution/src/test/java/org/apache/commons/statistics/distribution/NormalDistributionTest.java
@@ -160,21 +160,38 @@ public class NormalDistributionTest extends ContinuousDistributionAbstractTest {
      * Verifies fixes for JIRA MATH-167, MATH-414
      */
     @Test
-    public void testExtremeValues() {
-        NormalDistribution distribution = new NormalDistribution(0, 1);
+    public void testLowerTail() {
+        final NormalDistribution distribution = new NormalDistribution(0, 1);
+        for (int i = 0; i < 100; i++) { // make sure no convergence exception
+            final double lowerTail = distribution.cumulativeProbability(-i);
+            if (i < 39) { // make sure not top-coded
+                Assertions.assertTrue(lowerTail > 0);
+            } else { // make sure top coding not reversed
+                Assertions.assertEquals(0, lowerTail, 0d);
+            }
+        }
+    }
+
+    /**
+     * Check to make sure top-coding of extreme values works correctly.
+     * Verifies fixes for JIRA MATH-167, MATH-414
+     */
+    @Test
+    public void testUpperTail() {
+        final NormalDistribution distribution = new NormalDistribution(0, 1);
         for (int i = 0; i < 100; i++) { // make sure no convergence exception
-            double lowerTail = distribution.cumulativeProbability(-i);
-            double upperTail = distribution.cumulativeProbability(i);
+            final double upperTail = distribution.cumulativeProbability(i);
             if (i < 9) { // make sure not top-coded
-                // For i = 10, due to bad tail precision in erf (MATH-364), 1 is returned
-                // TODO: once MATH-364 is resolved, replace 9 with 30
-                Assertions.assertTrue(lowerTail > 0.0d);
-                Assertions.assertTrue(upperTail < 1.0d);
+                Assertions.assertTrue(upperTail < 1);
             } else { // make sure top coding not reversed
-                Assertions.assertTrue(lowerTail < 0.00001);
-                Assertions.assertTrue(upperTail > 0.99999);
+                Assertions.assertEquals(1, upperTail, 0d);
             }
         }
+    }
+
+    @Test
+    public void testExtremeValues() {
+        final NormalDistribution distribution = new NormalDistribution(0, 1);
 
         Assertions.assertEquals(1, distribution.cumulativeProbability(Double.MAX_VALUE), 0);
         Assertions.assertEquals(0, distribution.cumulativeProbability(-Double.MAX_VALUE), 0);


[commons-statistics] 03/05: Limit dependency to "test" scope.

Posted by er...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

erans pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-statistics.git

commit 3d6d665b710cc864480f9f8e6ae7e2f416239d28
Author: Gilles Sadowski <gi...@gmail.com>
AuthorDate: Sun Apr 12 12:44:09 2020 +0200

    Limit dependency to "test" scope.
---
 pom.xml | 1 +
 1 file changed, 1 insertion(+)

diff --git a/pom.xml b/pom.xml
index 8561d61..d67d29c 100644
--- a/pom.xml
+++ b/pom.xml
@@ -166,6 +166,7 @@
         <groupId>org.apache.commons</groupId>
         <artifactId>commons-math3</artifactId>
         <version>${statistics.commons.math3.version}</version>
+        <scope>test</scope>
       </dependency>
       <dependency>
         <groupId>org.junit</groupId>


[commons-statistics] 01/05: Upgrade CP.

Posted by er...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

erans pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-statistics.git

commit d26f43cb70d5cbb989575ae6e43b9e4f8cc7333d
Author: Gilles Sadowski <gi...@gmail.com>
AuthorDate: Sun Apr 12 12:34:53 2020 +0200

    Upgrade CP.
---
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index 5120a91..8561d61 100644
--- a/pom.xml
+++ b/pom.xml
@@ -19,7 +19,7 @@
   <parent>
     <groupId>org.apache.commons</groupId>
     <artifactId>commons-parent</artifactId>
-    <version>48</version>
+    <version>50</version>
   </parent>
 
   <modelVersion>4.0.0</modelVersion>


[commons-statistics] 05/05: STATISTICS-23: Order of arguments in "GammaDistribution" sampler.

Posted by er...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

erans pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-statistics.git

commit cbc1059a5156bbb1bb2b96d6ea323fd3ec601e05
Author: Gilles Sadowski <gi...@gmail.com>
AuthorDate: Sun Apr 12 13:24:14 2020 +0200

    STATISTICS-23: Order of arguments in "GammaDistribution" sampler.
    
    Cf. RNG-96.
---
 .../org/apache/commons/statistics/distribution/GammaDistribution.java   | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/commons-statistics-distribution/src/main/java/org/apache/commons/statistics/distribution/GammaDistribution.java b/commons-statistics-distribution/src/main/java/org/apache/commons/statistics/distribution/GammaDistribution.java
index f4e8dd0..225b19b 100644
--- a/commons-statistics-distribution/src/main/java/org/apache/commons/statistics/distribution/GammaDistribution.java
+++ b/commons-statistics-distribution/src/main/java/org/apache/commons/statistics/distribution/GammaDistribution.java
@@ -343,6 +343,6 @@ public class GammaDistribution extends AbstractContinuousDistribution {
     @Override
     public ContinuousDistribution.Sampler createSampler(final UniformRandomProvider rng) {
         // Gamma distribution sampler.
-        return new AhrensDieterMarsagliaTsangGammaSampler(rng, scale, shape)::sample;
+        return new AhrensDieterMarsagliaTsangGammaSampler(rng, shape, scale)::sample;
     }
 }