Repository: commons-math Updated Branches: refs/heads/master e3eff1e3a -> 44ab25696
MATH-1416: Depend on "Commons Numbers" (module "commons-numbers-gamma"). Project: http://git-wip-us.apache.org/repos/asf/commons-math/repo Commit: http://git-wip-us.apache.org/repos/asf/commons-math/commit/2ec4deac Tree: http://git-wip-us.apache.org/repos/asf/commons-math/tree/2ec4deac Diff: http://git-wip-us.apache.org/repos/asf/commons-math/diff/2ec4deac Branch: refs/heads/master Commit: 2ec4deacfda46ad85e3effb3171a5e330ea8e714 Parents: e3eff1e Author: Gilles <er...@apache.org> Authored: Sun May 14 23:28:59 2017 +0200 Committer: Gilles <er...@apache.org> Committed: Sun May 14 23:28:59 2017 +0200 ---------------------------------------------------------------------- .../apache/commons/math4/distribution/BetaDistribution.java | 4 ++-- .../commons/math4/distribution/BinomialDistribution.java | 6 +++--- .../apache/commons/math4/distribution/FDistribution.java | 7 ++++--- .../commons/math4/distribution/PascalDistribution.java | 6 +++--- .../apache/commons/math4/distribution/TDistribution.java | 9 ++++----- 5 files changed, 16 insertions(+), 16 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/commons-math/blob/2ec4deac/src/main/java/org/apache/commons/math4/distribution/BetaDistribution.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/commons/math4/distribution/BetaDistribution.java b/src/main/java/org/apache/commons/math4/distribution/BetaDistribution.java index 5ca3321..550e89d 100644 --- a/src/main/java/org/apache/commons/math4/distribution/BetaDistribution.java +++ b/src/main/java/org/apache/commons/math4/distribution/BetaDistribution.java @@ -18,7 +18,7 @@ package org.apache.commons.math4.distribution; import org.apache.commons.math4.exception.NumberIsTooSmallException; import org.apache.commons.math4.exception.util.LocalizedFormats; -import org.apache.commons.math4.special.Beta; +import org.apache.commons.numbers.gamma.RegularizedBeta; import org.apache.commons.numbers.gamma.LogGamma; import org.apache.commons.math4.util.FastMath; import org.apache.commons.rng.UniformRandomProvider; @@ -135,7 +135,7 @@ public class BetaDistribution extends AbstractRealDistribution { } else if (x >= 1) { return 1; } else { - return Beta.regularizedBeta(x, alpha, beta); + return RegularizedBeta.value(x, alpha, beta); } } http://git-wip-us.apache.org/repos/asf/commons-math/blob/2ec4deac/src/main/java/org/apache/commons/math4/distribution/BinomialDistribution.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/commons/math4/distribution/BinomialDistribution.java b/src/main/java/org/apache/commons/math4/distribution/BinomialDistribution.java index ffcc1b9..ef9c077 100644 --- a/src/main/java/org/apache/commons/math4/distribution/BinomialDistribution.java +++ b/src/main/java/org/apache/commons/math4/distribution/BinomialDistribution.java @@ -19,7 +19,7 @@ package org.apache.commons.math4.distribution; import org.apache.commons.math4.exception.NotPositiveException; import org.apache.commons.math4.exception.OutOfRangeException; import org.apache.commons.math4.exception.util.LocalizedFormats; -import org.apache.commons.math4.special.Beta; +import org.apache.commons.numbers.gamma.RegularizedBeta; import org.apache.commons.math4.util.FastMath; /** @@ -109,8 +109,8 @@ public class BinomialDistribution extends AbstractIntegerDistribution { } else if (x >= numberOfTrials) { ret = 1.0; } else { - ret = 1.0 - Beta.regularizedBeta(probabilityOfSuccess, - x + 1.0, numberOfTrials - x); + ret = 1.0 - RegularizedBeta.value(probabilityOfSuccess, + x + 1.0, numberOfTrials - x); } return ret; } http://git-wip-us.apache.org/repos/asf/commons-math/blob/2ec4deac/src/main/java/org/apache/commons/math4/distribution/FDistribution.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/commons/math4/distribution/FDistribution.java b/src/main/java/org/apache/commons/math4/distribution/FDistribution.java index bcde9aa..26caf51 100644 --- a/src/main/java/org/apache/commons/math4/distribution/FDistribution.java +++ b/src/main/java/org/apache/commons/math4/distribution/FDistribution.java @@ -19,7 +19,8 @@ package org.apache.commons.math4.distribution; import org.apache.commons.math4.exception.NotStrictlyPositiveException; import org.apache.commons.math4.exception.util.LocalizedFormats; -import org.apache.commons.math4.special.Beta; +import org.apache.commons.numbers.gamma.LogBeta; +import org.apache.commons.numbers.gamma.RegularizedBeta; import org.apache.commons.math4.util.FastMath; /** @@ -112,7 +113,7 @@ public class FDistribution extends AbstractRealDistribution { denominatorDegreesOfFreedom); return nhalf * logn + nhalf * logx - logx + mhalf * logm - nhalf * lognxm - mhalf * lognxm - - Beta.logBeta(nhalf, mhalf); + LogBeta.value(nhalf, mhalf); } /** @@ -135,7 +136,7 @@ public class FDistribution extends AbstractRealDistribution { double n = numeratorDegreesOfFreedom; double m = denominatorDegreesOfFreedom; - ret = Beta.regularizedBeta((n * x) / (m + n * x), + ret = RegularizedBeta.value((n * x) / (m + n * x), 0.5 * n, 0.5 * m); } http://git-wip-us.apache.org/repos/asf/commons-math/blob/2ec4deac/src/main/java/org/apache/commons/math4/distribution/PascalDistribution.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/commons/math4/distribution/PascalDistribution.java b/src/main/java/org/apache/commons/math4/distribution/PascalDistribution.java index 1394e30..f176865 100644 --- a/src/main/java/org/apache/commons/math4/distribution/PascalDistribution.java +++ b/src/main/java/org/apache/commons/math4/distribution/PascalDistribution.java @@ -19,7 +19,7 @@ package org.apache.commons.math4.distribution; import org.apache.commons.math4.exception.NotStrictlyPositiveException; import org.apache.commons.math4.exception.OutOfRangeException; import org.apache.commons.math4.exception.util.LocalizedFormats; -import org.apache.commons.math4.special.Beta; +import org.apache.commons.numbers.gamma.RegularizedBeta; import org.apache.commons.math4.util.CombinatoricsUtils; import org.apache.commons.math4.util.FastMath; @@ -155,8 +155,8 @@ public class PascalDistribution extends AbstractIntegerDistribution { if (x < 0) { ret = 0.0; } else { - ret = Beta.regularizedBeta(probabilityOfSuccess, - numberOfSuccesses, x + 1.0); + ret = RegularizedBeta.value(probabilityOfSuccess, + numberOfSuccesses, x + 1.0); } return ret; } http://git-wip-us.apache.org/repos/asf/commons-math/blob/2ec4deac/src/main/java/org/apache/commons/math4/distribution/TDistribution.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/commons/math4/distribution/TDistribution.java b/src/main/java/org/apache/commons/math4/distribution/TDistribution.java index 39fbd21..194ce94 100644 --- a/src/main/java/org/apache/commons/math4/distribution/TDistribution.java +++ b/src/main/java/org/apache/commons/math4/distribution/TDistribution.java @@ -18,7 +18,7 @@ package org.apache.commons.math4.distribution; import org.apache.commons.math4.exception.NotStrictlyPositiveException; import org.apache.commons.math4.exception.util.LocalizedFormats; -import org.apache.commons.math4.special.Beta; +import org.apache.commons.numbers.gamma.RegularizedBeta; import org.apache.commons.numbers.gamma.LogGamma; import org.apache.commons.math4.util.FastMath; @@ -111,10 +111,9 @@ public class TDistribution extends AbstractRealDistribution { ret = 0.5; } else { double t = - Beta.regularizedBeta( - degreesOfFreedom / (degreesOfFreedom + (x * x)), - 0.5 * degreesOfFreedom, - 0.5); + RegularizedBeta.value(degreesOfFreedom / (degreesOfFreedom + (x * x)), + 0.5 * degreesOfFreedom, + 0.5); if (x < 0.0) { ret = 0.5 * t; } else {