You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by tn...@apache.org on 2015/03/11 22:09:11 UTC

[math] [MATH-1209] Fix link to algorithm description in PoissonDistribution#sample(). Thanks to Jonathan Ogilvie

Repository: commons-math
Updated Branches:
  refs/heads/master da4cef072 -> bfb3cf8bb


[MATH-1209] Fix link to algorithm description in PoissonDistribution#sample(). Thanks to Jonathan Ogilvie


Project: http://git-wip-us.apache.org/repos/asf/commons-math/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-math/commit/bfb3cf8b
Tree: http://git-wip-us.apache.org/repos/asf/commons-math/tree/bfb3cf8b
Diff: http://git-wip-us.apache.org/repos/asf/commons-math/diff/bfb3cf8b

Branch: refs/heads/master
Commit: bfb3cf8bba6aab198c4644e236bbc9f3807111d0
Parents: da4cef0
Author: Thomas Neidhart <th...@gmail.com>
Authored: Wed Mar 11 22:08:57 2015 +0100
Committer: Thomas Neidhart <th...@gmail.com>
Committed: Wed Mar 11 22:08:57 2015 +0100

----------------------------------------------------------------------
 src/changes/changes.xml                                     | 3 +++
 .../commons/math4/distribution/PoissonDistribution.java     | 9 ++++++++-
 2 files changed, 11 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-math/blob/bfb3cf8b/src/changes/changes.xml
----------------------------------------------------------------------
diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index e7f2b92..f3cf214 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -54,6 +54,9 @@ If the output is not quite correct, check for invisible trailing spaces!
     </release>
 
     <release version="4.0" date="XXXX-XX-XX" description="">
+      <action dev="tn" type="fix" issue="MATH-1209" due-to="Jonathan Ogilvie">
+        Fixed link to algorithm description in "PoissonDistribution#sample()".
+      </action>
       <action dev="tn" type="update" issue="MATH-757">
         Removed broken synchronization support in "ResizableDoubleArray".
       </action>

http://git-wip-us.apache.org/repos/asf/commons-math/blob/bfb3cf8b/src/main/java/org/apache/commons/math4/distribution/PoissonDistribution.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/math4/distribution/PoissonDistribution.java b/src/main/java/org/apache/commons/math4/distribution/PoissonDistribution.java
index 7463925..731a6ac 100644
--- a/src/main/java/org/apache/commons/math4/distribution/PoissonDistribution.java
+++ b/src/main/java/org/apache/commons/math4/distribution/PoissonDistribution.java
@@ -173,6 +173,7 @@ public class PoissonDistribution extends AbstractIntegerDistribution {
     }
 
     /** {@inheritDoc} */
+    @Override
     public double probability(int x) {
         final double logProbability = logProbability(x);
         return logProbability == Double.NEGATIVE_INFINITY ? 0 : FastMath.exp(logProbability);
@@ -195,6 +196,7 @@ public class PoissonDistribution extends AbstractIntegerDistribution {
     }
 
     /** {@inheritDoc} */
+    @Override
     public double cumulativeProbability(int x) {
         if (x < 0) {
             return 0;
@@ -227,6 +229,7 @@ public class PoissonDistribution extends AbstractIntegerDistribution {
      *
      * For mean parameter {@code p}, the mean is {@code p}.
      */
+    @Override
     public double getNumericalMean() {
         return getMean();
     }
@@ -236,6 +239,7 @@ public class PoissonDistribution extends AbstractIntegerDistribution {
      *
      * For mean parameter {@code p}, the variance is {@code p}.
      */
+    @Override
     public double getNumericalVariance() {
         return getMean();
     }
@@ -247,6 +251,7 @@ public class PoissonDistribution extends AbstractIntegerDistribution {
      *
      * @return lower bound of the support (always 0)
      */
+    @Override
     public int getSupportLowerBound() {
         return 0;
     }
@@ -261,6 +266,7 @@ public class PoissonDistribution extends AbstractIntegerDistribution {
      * @return upper bound of the support (always {@code Integer.MAX_VALUE} for
      * positive infinity)
      */
+    @Override
     public int getSupportUpperBound() {
         return Integer.MAX_VALUE;
     }
@@ -272,6 +278,7 @@ public class PoissonDistribution extends AbstractIntegerDistribution {
      *
      * @return {@code true}
      */
+    @Override
     public boolean isSupportConnected() {
         return true;
     }
@@ -283,7 +290,7 @@ public class PoissonDistribution extends AbstractIntegerDistribution {
      * <ul>
      *  <li>For small means, uses simulation of a Poisson process
      *   using Uniform deviates, as described
-     *   <a href="http://irmi.epfl.ch/cmos/Pmmi/interactive/rng7.htm"> here</a>.
+     *   <a href="http://mathaa.epfl.ch/cours/PMMI2001/interactive/rng7.htm"> here</a>.
      *   The Poisson process (and hence value returned) is bounded by 1000 * mean.
      *  </li>
      *  <li>For large means, uses the rejection algorithm described in