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 f3be82249ed8fd84aba10bf7701e77af8ebe76d3
Author: aherbert <[email protected]>
AuthorDate: Fri Jul 30 12:11:11 2021 +0100

    Move logProbability after probability and before cumulativeProbability
    
    This matches the order in the ContinuousDistribution interface
---
 .../distribution/DiscreteDistribution.java         | 26 +++++++++++-----------
 1 file changed, 13 insertions(+), 13 deletions(-)

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 292828c..4c22b8a 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
@@ -25,19 +25,6 @@ public interface DiscreteDistribution {
 
     /**
      * For a random variable {@code X} whose values are distributed according
-     * to this distribution, this method returns {@code log(P(X = x))}, where
-     * {@code log} is the natural logarithm.
-     *
-     * @param x Point at which the PMF is evaluated.
-     * @return the logarithm of the value of the probability mass function at
-     * {@code x}.
-     */
-    default double logProbability(int x) {
-        return Math.log(probability(x));
-    }
-
-    /**
-     * For a random variable {@code X} whose values are distributed according
      * to this distribution, this method returns {@code P(X = x)}.
      * In other words, this method represents the probability mass function 
(PMF)
      * for the distribution.
@@ -62,6 +49,19 @@ public interface DiscreteDistribution {
 
     /**
      * For a random variable {@code X} whose values are distributed according
+     * to this distribution, this method returns {@code log(P(X = x))}, where
+     * {@code log} is the natural logarithm.
+     *
+     * @param x Point at which the PMF is evaluated.
+     * @return the logarithm of the value of the probability mass function at
+     * {@code x}.
+     */
+    default double logProbability(int x) {
+        return Math.log(probability(x));
+    }
+
+    /**
+     * For a random variable {@code X} whose values are distributed according
      * to this distribution, this method returns {@code P(X <= x)}.
      * In other, words, this method represents the (cumulative) distribution
      * function (CDF) for this distribution.

Reply via email to