commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From celes...@apache.org
Subject svn commit: r1210756 - in /commons/proper/math/trunk/src/main/java/org/apache/commons/math/distribution: BetaDistribution.java ChiSquaredDistribution.java FDistribution.java GammaDistribution.java NormalDistribution.java TDistribution.java
Date Tue, 06 Dec 2011 02:57:46 GMT
Author: celestin
Date: Tue Dec  6 02:57:46 2011
New Revision: 1210756

URL: http://svn.apache.org/viewvc?rev=1210756&view=rev
Log:
In distribution.AbstractRealDistribution.inverseCumulativeProbability(double), boundary cases
(p == 0 and p == 1) are now handled correctly: concrete instances no longer need to override
this method, which is removed (MATH-699).

Modified:
    commons/proper/math/trunk/src/main/java/org/apache/commons/math/distribution/BetaDistribution.java
    commons/proper/math/trunk/src/main/java/org/apache/commons/math/distribution/ChiSquaredDistribution.java
    commons/proper/math/trunk/src/main/java/org/apache/commons/math/distribution/FDistribution.java
    commons/proper/math/trunk/src/main/java/org/apache/commons/math/distribution/GammaDistribution.java
    commons/proper/math/trunk/src/main/java/org/apache/commons/math/distribution/NormalDistribution.java
    commons/proper/math/trunk/src/main/java/org/apache/commons/math/distribution/TDistribution.java

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/distribution/BetaDistribution.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/distribution/BetaDistribution.java?rev=1210756&r1=1210755&r2=1210756&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math/distribution/BetaDistribution.java
(original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/distribution/BetaDistribution.java
Tue Dec  6 02:57:46 2011
@@ -134,18 +134,6 @@ public class BetaDistribution extends Ab
     }
 
     /** {@inheritDoc} */
-    @Override
-    public double inverseCumulativeProbability(double p)  {
-        if (p == 0) {
-            return 0;
-        } else if (p == 1) {
-            return 1;
-        } else {
-            return super.inverseCumulativeProbability(p);
-        }
-    }
-
-    /** {@inheritDoc} */
     public double cumulativeProbability(double x)  {
         if (x <= 0) {
             return 0;

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/distribution/ChiSquaredDistribution.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/distribution/ChiSquaredDistribution.java?rev=1210756&r1=1210755&r2=1210756&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math/distribution/ChiSquaredDistribution.java
(original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/distribution/ChiSquaredDistribution.java
Tue Dec  6 02:57:46 2011
@@ -91,23 +91,6 @@ public class ChiSquaredDistribution exte
         return gamma.cumulativeProbability(x);
     }
 
-    /**
-     * {@inheritDoc}
-     *
-     * Returns {@code 0} when {@code p == 0} and
-     * {@code Double.POSITIVE_INFINITY} when {@code p == 1}.
-     */
-    @Override
-    public double inverseCumulativeProbability(final double p) {
-        if (p == 0) {
-            return 0d;
-        }
-        if (p == 1) {
-            return Double.POSITIVE_INFINITY;
-        }
-        return super.inverseCumulativeProbability(p);
-    }
-
     /** {@inheritDoc} */
     @Override
     protected double getSolverAbsoluteAccuracy() {

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/distribution/FDistribution.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/distribution/FDistribution.java?rev=1210756&r1=1210755&r2=1210756&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math/distribution/FDistribution.java
(original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/distribution/FDistribution.java
Tue Dec  6 02:57:46 2011
@@ -18,7 +18,6 @@
 package org.apache.commons.math.distribution;
 
 import org.apache.commons.math.exception.NotStrictlyPositiveException;
-import org.apache.commons.math.exception.OutOfRangeException;
 import org.apache.commons.math.exception.util.LocalizedFormats;
 import org.apache.commons.math.special.Beta;
 import org.apache.commons.math.util.FastMath;
@@ -156,23 +155,6 @@ public class FDistribution extends Abstr
     }
 
     /**
-     * {@inheritDoc}
-     *
-     * Returns {@code 0} when {@code p == 0} and
-     * {@code Double.POSITIVE_INFINITY} when {@code p == 1}.
-     */
-    @Override
-    public double inverseCumulativeProbability(final double p) throws OutOfRangeException
{
-        if (p == 0) {
-            return 0;
-        }
-        if (p == 1) {
-            return Double.POSITIVE_INFINITY;
-        }
-        return super.inverseCumulativeProbability(p);
-    }
-
-    /**
      * Access the numerator degrees of freedom.
      *
      * @return the numerator degrees of freedom.

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/distribution/GammaDistribution.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/distribution/GammaDistribution.java?rev=1210756&r1=1210755&r2=1210756&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math/distribution/GammaDistribution.java
(original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/distribution/GammaDistribution.java
Tue Dec  6 02:57:46 2011
@@ -144,23 +144,6 @@ public class GammaDistribution extends A
         return ret;
     }
 
-    /**
-     * {@inheritDoc}
-     *
-     * Returns {@code 0} when {@code p == 0} and
-     * {@code Double.POSITIVE_INFINITY} when {@code p == 1}.
-     */
-    @Override
-    public double inverseCumulativeProbability(final double p) {
-        if (p == 0) {
-            return 0;
-        }
-        if (p == 1) {
-            return Double.POSITIVE_INFINITY;
-        }
-        return super.inverseCumulativeProbability(p);
-    }
-
     /** {@inheritDoc} */
     @Override
     protected double getSolverAbsoluteAccuracy() {

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/distribution/NormalDistribution.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/distribution/NormalDistribution.java?rev=1210756&r1=1210755&r2=1210756&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math/distribution/NormalDistribution.java
(original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/distribution/NormalDistribution.java
Tue Dec  6 02:57:46 2011
@@ -155,23 +155,6 @@ public class NormalDistribution extends 
         return 0.5 * Erf.erf(v0, v1);
     }
 
-    /**
-     * {@inheritDoc}
-     *
-     * Returns {@code Double.NEGATIVE_INFINITY} when {@code p == 0}
-     * and {@code Double.POSITIVE_INFINITY} for {@code p == 1}.
-     */
-    @Override
-    public double inverseCumulativeProbability(final double p) {
-        if (p == 0) {
-            return Double.NEGATIVE_INFINITY;
-        }
-        if (p == 1) {
-            return Double.POSITIVE_INFINITY;
-        }
-        return super.inverseCumulativeProbability(p);
-    }
-
     /** {@inheritDoc} */
     @Override
     protected double getSolverAbsoluteAccuracy() {

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/distribution/TDistribution.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/distribution/TDistribution.java?rev=1210756&r1=1210755&r2=1210756&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math/distribution/TDistribution.java
(original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/distribution/TDistribution.java
Tue Dec  6 02:57:46 2011
@@ -126,23 +126,6 @@ public class TDistribution extends Abstr
         return ret;
     }
 
-    /**
-     * {@inheritDoc}
-     *
-     * Returns {@code Double.NEGATIVE_INFINITY} when {@code p = 0}
-     * and {@code Double.POSITIVE_INFINITY} when {@code p = 1}.
-     */
-    @Override
-    public double inverseCumulativeProbability(final double p) {
-        if (p == 0) {
-            return Double.NEGATIVE_INFINITY;
-        }
-        if (p == 1) {
-            return Double.POSITIVE_INFINITY;
-        }
-        return super.inverseCumulativeProbability(p);
-    }
-
     /** {@inheritDoc} */
     @Override
     protected double getSolverAbsoluteAccuracy() {



Mime
View raw message