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 2023/02/17 18:16:39 UTC

[commons-statistics] branch master updated (495850e -> 7b62d17)

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

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


    from 495850e  Correct malformed javadoc single quote using encoded character
     new b3e4e96  Correct test message typo
     new 7b62d17  Correct inverse survival function definition.

The 2 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/ContinuousDistribution.java       |  4 ++--
 .../commons/statistics/distribution/DiscreteDistribution.java |  4 ++--
 .../statistics/distribution/BaseDiscreteDistributionTest.java |  2 +-
 src/site/xdoc/userguide/index.xml                             | 11 ++++++-----
 4 files changed, 11 insertions(+), 10 deletions(-)


[commons-statistics] 02/02: Correct inverse survival function definition.

Posted by ah...@apache.org.
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-statistics.git

commit 7b62d17a7f34d96580dc7160ade80c7170a488eb
Author: aherbert <ah...@apache.org>
AuthorDate: Fri Feb 17 17:41:32 2023 +0000

    Correct inverse survival function definition.
    
    SF = P(X > x) and not P(X >= x)
---
 .../statistics/distribution/ContinuousDistribution.java       |  4 ++--
 .../commons/statistics/distribution/DiscreteDistribution.java |  4 ++--
 src/site/xdoc/userguide/index.xml                             | 11 ++++++-----
 3 files changed, 10 insertions(+), 9 deletions(-)

diff --git a/commons-statistics-distribution/src/main/java/org/apache/commons/statistics/distribution/ContinuousDistribution.java b/commons-statistics-distribution/src/main/java/org/apache/commons/statistics/distribution/ContinuousDistribution.java
index 1860ac6..dfed1bf 100644
--- a/commons-statistics-distribution/src/main/java/org/apache/commons/statistics/distribution/ContinuousDistribution.java
+++ b/commons-statistics-distribution/src/main/java/org/apache/commons/statistics/distribution/ContinuousDistribution.java
@@ -122,8 +122,8 @@ public interface ContinuousDistribution {
      * returned value is:
      *
      * <p>\[ x = \begin{cases}
-     *       \inf \{ x \in \mathbb R : P(X \ge x) \le p\}   &amp; \text{for } 0 \le p \lt 1 \\
-     *       \inf \{ x \in \mathbb R : P(X \ge x) \lt 1 \}  &amp; \text{for } p = 1
+     *       \inf \{ x \in \mathbb R : P(X \gt x) \le p\}   &amp; \text{for } 0 \le p \lt 1 \\
+     *       \inf \{ x \in \mathbb R : P(X \gt x) \lt 1 \}  &amp; \text{for } p = 1
      *       \end{cases} \]
      *
      * <p>By default, this is defined as {@code inverseCumulativeProbability(1 - p)}, but
diff --git a/commons-statistics-distribution/src/main/java/org/apache/commons/statistics/distribution/DiscreteDistribution.java b/commons-statistics-distribution/src/main/java/org/apache/commons/statistics/distribution/DiscreteDistribution.java
index 815cb94..bc99e52 100644
--- a/commons-statistics-distribution/src/main/java/org/apache/commons/statistics/distribution/DiscreteDistribution.java
+++ b/commons-statistics-distribution/src/main/java/org/apache/commons/statistics/distribution/DiscreteDistribution.java
@@ -136,8 +136,8 @@ public interface DiscreteDistribution {
      * the returned value is:
      *
      * <p>\[ x = \begin{cases}
-     *       \inf \{ x \in \mathbb Z : P(X \ge x) \le p\}   &amp; \text{for } 0 \le p \lt 1 \\
-     *       \inf \{ x \in \mathbb Z : P(X \ge x) \lt 1 \}  &amp; \text{for } p = 1
+     *       \inf \{ x \in \mathbb Z : P(X \gt x) \le p\}   &amp; \text{for } 0 \le p \lt 1 \\
+     *       \inf \{ x \in \mathbb Z : P(X \gt x) \lt 1 \}  &amp; \text{for } p = 1
      *       \end{cases} \]
      *
      * <p>If the result exceeds the range of the data type {@code int},
diff --git a/src/site/xdoc/userguide/index.xml b/src/site/xdoc/userguide/index.xml
index ad4e074..4ddcee5 100644
--- a/src/site/xdoc/userguide/index.xml
+++ b/src/site/xdoc/userguide/index.xml
@@ -165,8 +165,8 @@ double p3 = pd.probability(4, 5);
         </p>
         <p>
           \[ x = \begin{cases}
-             \inf \{ x \in \mathbb R : P(X \ge x) \le p\}   &amp; \text{for } 0 \le p \lt 1 \\
-             \inf \{ x \in \mathbb R : P(X \ge x) \lt 1 \}  &amp; \text{for } p = 1
+             \inf \{ x \in \mathbb R : P(X \gt x) \le p\}   &amp; \text{for } 0 \le p \lt 1 \\
+             \inf \{ x \in \mathbb R : P(X \gt x) \lt 1 \}  &amp; \text{for } p = 1
              \end{cases} \]
         </p>
 <source class="prettyprint">
@@ -177,9 +177,10 @@ double x2 = n.inverseSurvivalProbability(1e-300);
 </source>
         <p>
           For discrete <code>F</code>, the definition is the same, with \( \mathbb Z \)
-          (the integers) in place of \( \mathbb R \) (but note that, in the discrete case,
-          the &ge; in the definition can make a difference when <code>p</code> is an attained
-          value of the distribution).
+          (the integers) in place of \( \mathbb R \). Note that, in the discrete case,
+          the strict inequality on \( p \) in the definition can make a difference when
+          \( p \) is an attained value of the distribution. For example moving to the next
+          larger value of \( p \) will return the value \( x + 1 \) for inverse CDF.
         </p>
         <p>
           All distributions provide accessors for the parameters used to create the distribution,


[commons-statistics] 01/02: Correct test message typo

Posted by ah...@apache.org.
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-statistics.git

commit b3e4e9699148c1d1f6ffc47b9d834d224bf8ea15
Author: aherbert <ah...@apache.org>
AuthorDate: Fri Feb 17 14:28:49 2023 +0000

    Correct test message typo
---
 .../commons/statistics/distribution/BaseDiscreteDistributionTest.java   | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/commons-statistics-distribution/src/test/java/org/apache/commons/statistics/distribution/BaseDiscreteDistributionTest.java b/commons-statistics-distribution/src/test/java/org/apache/commons/statistics/distribution/BaseDiscreteDistributionTest.java
index e22432f..e31dc94 100644
--- a/commons-statistics-distribution/src/test/java/org/apache/commons/statistics/distribution/BaseDiscreteDistributionTest.java
+++ b/commons-statistics-distribution/src/test/java/org/apache/commons/statistics/distribution/BaseDiscreteDistributionTest.java
@@ -783,7 +783,7 @@ abstract class BaseDiscreteDistributionTest
                     Assertions.assertEquals(
                         x,
                         xx,
-                        () -> "Incorrect CDF inverse value returned for " + px);
+                        () -> "Incorrect SF inverse value returned for " + px);
                 }
             }
         }