You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by ah...@apache.org on 2019/07/23 13:38:08 UTC

[commons-rng] branch master updated: Update test p-value from 0.01 to 0.0001.

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

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


The following commit(s) were added to refs/heads/master by this push:
     new 70002ec  Update test p-value from 0.01 to 0.0001.
70002ec is described below

commit 70002ecdc89982e7e6b9f74dee74e4535001b4e1
Author: aherbert <ah...@apache.org>
AuthorDate: Tue Jul 23 14:38:02 2019 +0100

    Update test p-value from 0.01 to 0.0001.
    
    Re-runs are not configured for rng-simple. The effect is the same as
    configuring 1 re-run as per the rng-sampling module.
---
 .../apache/commons/rng/simple/internal/SeedFactoryTest.java    | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/internal/SeedFactoryTest.java b/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/internal/SeedFactoryTest.java
index 41e09ab..8894b6a 100644
--- a/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/internal/SeedFactoryTest.java
+++ b/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/internal/SeedFactoryTest.java
@@ -177,7 +177,7 @@ public class SeedFactoryTest {
      * Assert that the number of 1 bits is approximately 50%. This is based upon a
      * fixed-step "random walk" of +1/-1 from zero.
      *
-     * <p>The test is equivalent to the NIST Monobit test with a fixed p-value of 0.01.
+     * <p>The test is equivalent to the NIST Monobit test with a fixed p-value of 0.0001.
      * The number of bits is recommended to be above 100.</p>
      *
      * @see <A
@@ -193,13 +193,15 @@ public class SeedFactoryTest {
         final double sum = 2.0 * bitCount - numberOfBits;
         // The reference distribution is Normal with a standard deviation of sqrt(n).
         // Check the absolute position is not too far from the mean of 0 with a fixed
-        // p-value of 0.01 taken from a 2-tailed Normal distribution. Computation of
+        // p-value of 0.0001 taken from a 2-tailed Normal distribution. Computation of
         // the p-value requires the complimentary error function.
+        // The p-value is set to be equal to a 0.01 with 1 allowed re-run.
+        // (Re-runs are not configured for this test.) 
         final double absSum = Math.abs(sum);
-        final double max = Math.sqrt(numberOfBits) * 2.576;
+        final double max = Math.sqrt(numberOfBits) * 3.891;
         Assert.assertTrue("Walked too far astray: " + absSum +
                           " > " + max +
-                          " (test will fail randomly about 1 in 100 times)",
+                          " (test will fail randomly about 1 in 10,000 times)",
                           absSum <= max);
     }