From 6ad3d5edf1228825ec1ca6b77bf0fef42b396730 Mon Sep 17 00:00:00 2001
From: Gilles Sadowski This implementation computes erf(x) using the
* {@link Gamma#regularizedGammaP(double, double, double, int) regularized gamma function},
* following Erf, equation (3) The value returned is always between -1 and 1 (inclusive). If {@code abs(x) > 40}, then
* {@code erf(x)} is indistinguishable from either 1 or -1 as a double, so the appropriate extreme
* value is returned. Returns the complementary error function erfc(x) = 2/√π x∫∞ e-t2dt This implementation computes erfc(x) using the
* {@link Gamma#regularizedGammaQ(double, double, double, int) regularized gamma function},
* following Erf, equation (3). The value returned is always between 0 and 2 (inclusive). If {@code abs(x) > 40}, then
* {@code erf(x)} is indistinguishable from either 0 or 2 as a double, so the appropriate extreme
* value is returned.s1
and
+ *
+ * For first shape parameter s1
and
* second shape parameter s2
, the mean is
* s1 / (s1 + s2)
*
@@ -226,9 +226,9 @@ public class BetaDistributionImpl
/**
* {@inheritDoc}
- *
- * For first shape parameter s1
and
- * second shape parameter s2
,
+ *
+ * For first shape parameter s1
and
+ * second shape parameter s2
,
* the variance is
* [ s1 * s2 ] / [ (s1 + s2)^2 * (s1 + s2 + 1) ]
*
@@ -237,7 +237,7 @@ public class BetaDistributionImpl
@Override
protected double calculateNumericalVariance() {
final double a = getAlpha();
- final double b = getBeta();
+ final double b = getBeta();
final double alphabetasum = a + b;
return (a * b) / ((alphabetasum * alphabetasum) * (alphabetasum + 1));
}
diff --git a/src/main/java/org/apache/commons/math/distribution/BinomialDistributionImpl.java b/src/main/java/org/apache/commons/math/distribution/BinomialDistributionImpl.java
index dcea662de..346f7557d 100644
--- a/src/main/java/org/apache/commons/math/distribution/BinomialDistributionImpl.java
+++ b/src/main/java/org/apache/commons/math/distribution/BinomialDistributionImpl.java
@@ -167,8 +167,8 @@ public class BinomialDistributionImpl extends AbstractIntegerDistribution
/**
* {@inheritDoc}
- *
- * The lower bound of the support is always 0 no matter the number of trials
+ *
+ * The lower bound of the support is always 0 no matter the number of trials
* and probability parameter.
*
* @return lower bound of the support (always 0)
@@ -177,10 +177,10 @@ public class BinomialDistributionImpl extends AbstractIntegerDistribution
public int getSupportLowerBound() {
return 0;
}
-
+
/**
* {@inheritDoc}
- *
+ *
* The upper bound of the support is the number of trials.
*
* @return upper bound of the support (equal to number of trials)
@@ -192,8 +192,8 @@ public class BinomialDistributionImpl extends AbstractIntegerDistribution
/**
* {@inheritDoc}
- *
- * For n
number of trials and
+ *
+ * For n
number of trials and
* probability parameter p
, the mean is
* n * p
*
@@ -206,8 +206,8 @@ public class BinomialDistributionImpl extends AbstractIntegerDistribution
/**
* {@inheritDoc}
- *
- * For n
number of trials and
+ *
+ * For n
number of trials and
* probability parameter p
, the variance is
* n * p * (1 - p)
*
diff --git a/src/main/java/org/apache/commons/math/distribution/CauchyDistributionImpl.java b/src/main/java/org/apache/commons/math/distribution/CauchyDistributionImpl.java
index ef0fc7d90..ac3760f56 100644
--- a/src/main/java/org/apache/commons/math/distribution/CauchyDistributionImpl.java
+++ b/src/main/java/org/apache/commons/math/distribution/CauchyDistributionImpl.java
@@ -163,7 +163,7 @@ public class CauchyDistributionImpl extends AbstractContinuousDistribution
}
return ret;
- }
+ }
/**
* Access the domain value upper bound, based on p
, used to
@@ -223,8 +223,8 @@ public class CauchyDistributionImpl extends AbstractContinuousDistribution
/**
* {@inheritDoc}
- *
- * The lower bound of the support is always negative infinity no matter
+ *
+ * The lower bound of the support is always negative infinity no matter
* the parameters.
*
* @return lower bound of the support (always Double.NEGATIVE_INFINITY)
@@ -236,8 +236,8 @@ public class CauchyDistributionImpl extends AbstractContinuousDistribution
/**
* {@inheritDoc}
- *
- * The upper bound of the support is always positive infinity no matter
+ *
+ * The upper bound of the support is always positive infinity no matter
* the parameters.
*
* @return upper bound of the support (always Double.POSITIVE_INFINITY)
@@ -249,7 +249,7 @@ public class CauchyDistributionImpl extends AbstractContinuousDistribution
/**
* {@inheritDoc}
- *
+ *
* The mean is always undefined no matter the parameters.
*
* @return mean (always Double.NaN)
@@ -261,7 +261,7 @@ public class CauchyDistributionImpl extends AbstractContinuousDistribution
/**
* {@inheritDoc}
- *
+ *
* The variance is always undefined no matter the parameters.
*
* @return variance (always Double.NaN)
diff --git a/src/main/java/org/apache/commons/math/distribution/ChiSquaredDistributionImpl.java b/src/main/java/org/apache/commons/math/distribution/ChiSquaredDistributionImpl.java
index 988841184..7c0f03c9c 100644
--- a/src/main/java/org/apache/commons/math/distribution/ChiSquaredDistributionImpl.java
+++ b/src/main/java/org/apache/commons/math/distribution/ChiSquaredDistributionImpl.java
@@ -196,8 +196,8 @@ public class ChiSquaredDistributionImpl
/**
* {@inheritDoc}
- *
- * The lower bound of the support is always 0 no matter the
+ *
+ * The lower bound of the support is always 0 no matter the
* degrees of freedom.
*
* @return lower bound of the support (always 0)
@@ -209,8 +209,8 @@ public class ChiSquaredDistributionImpl
/**
* {@inheritDoc}
- *
- * The upper bound of the support is always positive infinity no matter the
+ *
+ * The upper bound of the support is always positive infinity no matter the
* degrees of freedom.
*
* @return upper bound of the support (always Double.POSITIVE_INFINITY)
@@ -222,7 +222,7 @@ public class ChiSquaredDistributionImpl
/**
* {@inheritDoc}
- *
+ *
* For k
degrees of freedom, the mean is
* k
*
@@ -235,7 +235,7 @@ public class ChiSquaredDistributionImpl
/**
* {@inheritDoc}
- *
+ *
* For k
degrees of freedom, the variance is
* 2 * k
*
diff --git a/src/main/java/org/apache/commons/math/distribution/Distribution.java b/src/main/java/org/apache/commons/math/distribution/Distribution.java
index 3edc3a4d2..2b58d8588 100644
--- a/src/main/java/org/apache/commons/math/distribution/Distribution.java
+++ b/src/main/java/org/apache/commons/math/distribution/Distribution.java
@@ -52,55 +52,55 @@ public interface Distribution {
* @throws IllegalArgumentException if x0 > x1
*/
double cumulativeProbability(double x0, double x1) throws MathException;
-
+
/**
- * Use this method to get the numerical value of the mean of this
+ * Use this method to get the numerical value of the mean of this
* distribution.
*
* @return the mean or Double.NaN if it's not defined
*/
double getNumericalMean();
-
+
/**
- * Use this method to get the numerical value of the variance of this
+ * Use this method to get the numerical value of the variance of this
* distribution.
*
- * @return the variance (possibly Double.POSITIVE_INFINITY as
- * for certain cases in {@link TDistributionImpl}) or
+ * @return the variance (possibly Double.POSITIVE_INFINITY as
+ * for certain cases in {@link TDistributionImpl}) or
* Double.NaN if it's not defined
*/
- double getNumericalVariance();
-
+ double getNumericalVariance();
+
/**
- * Use this method to get information about whether the lower bound
+ * Use this method to get information about whether the lower bound
* of the support is inclusive or not.
*
* @return whether the lower bound of the support is inclusive or not
*/
boolean isSupportLowerBoundInclusive();
-
+
/**
- * Use this method to get information about whether the upper bound
+ * Use this method to get information about whether the upper bound
* of the support is inclusive or not.
*
* @return whether the upper bound of the support is inclusive or not
*/
- boolean isSupportUpperBoundInclusive();
-
+ boolean isSupportUpperBoundInclusive();
+
/**
- * Use this method to get information about whether the support is connected,
+ * Use this method to get information about whether the support is connected,
* i.e. whether all values between the lower and upper bound of the support
* is included in the support.
- *
+ *
* For {@link AbstractIntegerDistribution} the support is discrete, so
- * if this is true, then the support is
+ * if this is true, then the support is
* {lower bound, lower bound + 1, ..., upper bound}.
- *
+ *
* For {@link AbstractContinuousDistribution} the support is continuous, so
* if this is true, then the support is the interval
* [lower bound, upper bound]
- * where the limits are inclusive or not according to
- * {@link #isSupportLowerBoundInclusive()} and {@link #isSupportUpperBoundInclusive()}
+ * where the limits are inclusive or not according to
+ * {@link #isSupportLowerBoundInclusive()} and {@link #isSupportUpperBoundInclusive()}
* (in the example both are true). If both are false, then the support is the interval
* (lower bound, upper bound)
*
diff --git a/src/main/java/org/apache/commons/math/distribution/ExponentialDistributionImpl.java b/src/main/java/org/apache/commons/math/distribution/ExponentialDistributionImpl.java
index ae11154c3..5ed54648c 100644
--- a/src/main/java/org/apache/commons/math/distribution/ExponentialDistributionImpl.java
+++ b/src/main/java/org/apache/commons/math/distribution/ExponentialDistributionImpl.java
@@ -225,7 +225,7 @@ public class ExponentialDistributionImpl extends AbstractContinuousDistribution
/**
* {@inheritDoc}
- *
+ *
* The lower bound of the support is always 0 no matter the mean parameter.
*
* @return lower bound of the support (always 0)
@@ -237,8 +237,8 @@ public class ExponentialDistributionImpl extends AbstractContinuousDistribution
/**
* {@inheritDoc}
- *
- * The upper bound of the support is always positive infinity
+ *
+ * The upper bound of the support is always positive infinity
* no matter the mean parameter.
*
* @return upper bound of the support (always Double.POSITIVE_INFINITY)
@@ -250,7 +250,7 @@ public class ExponentialDistributionImpl extends AbstractContinuousDistribution
/**
* {@inheritDoc}
- *
+ *
* For mean parameter k
, the mean is
* k
*
@@ -263,7 +263,7 @@ public class ExponentialDistributionImpl extends AbstractContinuousDistribution
/**
* {@inheritDoc}
- *
+ *
* For mean parameter k
, the variance is
* k^2
*
diff --git a/src/main/java/org/apache/commons/math/distribution/FDistributionImpl.java b/src/main/java/org/apache/commons/math/distribution/FDistributionImpl.java
index af9cfe8ae..ae7dc1063 100644
--- a/src/main/java/org/apache/commons/math/distribution/FDistributionImpl.java
+++ b/src/main/java/org/apache/commons/math/distribution/FDistributionImpl.java
@@ -235,10 +235,10 @@ public class FDistributionImpl
protected double getSolverAbsoluteAccuracy() {
return solverAbsoluteAccuracy;
}
-
+
/**
* {@inheritDoc}
- *
+ *
* The lower bound of the support is always 0 no matter the parameters.
*
* @return lower bound of the support (always 0)
@@ -250,8 +250,8 @@ public class FDistributionImpl
/**
* {@inheritDoc}
- *
- * The upper bound of the support is always positive infinity
+ *
+ * The upper bound of the support is always positive infinity
* no matter the parameters.
*
* @return upper bound of the support (always Double.POSITIVE_INFINITY)
@@ -263,8 +263,8 @@ public class FDistributionImpl
/**
* {@inheritDoc}
- *
- * For denominator degrees of freedom parameter b
,
+ *
+ * For denominator degrees of freedom parameter b
,
* the mean is
*
*
*
* @return {@inheritDoc}
- */
+ */
@Override
- protected double calculateNumericalMean() {
+ protected double calculateNumericalMean() {
final double denominatorDF = getDenominatorDegreesOfFreedom();
if (denominatorDF > 2) {
- return denominatorDF / (denominatorDF - 2);
+ return denominatorDF / (denominatorDF - 2);
}
-
+
return Double.NaN;
}
/**
* {@inheritDoc}
- *
- * For numerator degrees of freedom parameter b > 2
then b / (b - 2)
a
- * and denominator degrees of freedom parameter b
,
+ *
+ * For numerator degrees of freedom parameter a
+ * and denominator degrees of freedom parameter b
,
* the variance is
*
*
b > 4
then
+ * if b > 4
then
* [ 2 * b^2 * (a + b - 2) ] / [ a * (b - 2)^2 * (b - 4) ]
* undefined
@@ -307,12 +307,12 @@ public class FDistributionImpl
if (denominatorDF > 4) {
final double numeratorDF = getNumeratorDegreesOfFreedom();
final double denomDFMinusTwo = denominatorDF - 2;
-
+
return ( 2 * (denominatorDF * denominatorDF) * (numeratorDF + denominatorDF - 2) ) /
( (numeratorDF * (denomDFMinusTwo * denomDFMinusTwo) * (denominatorDF - 4)) );
}
-
- return Double.NaN;
+
+ return Double.NaN;
}
/**
diff --git a/src/main/java/org/apache/commons/math/distribution/GammaDistributionImpl.java b/src/main/java/org/apache/commons/math/distribution/GammaDistributionImpl.java
index 3936aa0c1..0c50974ce 100644
--- a/src/main/java/org/apache/commons/math/distribution/GammaDistributionImpl.java
+++ b/src/main/java/org/apache/commons/math/distribution/GammaDistributionImpl.java
@@ -240,7 +240,7 @@ public class GammaDistributionImpl extends AbstractContinuousDistribution
/**
* {@inheritDoc}
- *
+ *
* The lower bound of the support is always 0 no matter the parameters.
*
* @return lower bound of the support (always 0)
@@ -252,8 +252,8 @@ public class GammaDistributionImpl extends AbstractContinuousDistribution
/**
* {@inheritDoc}
- *
- * The upper bound of the support is always positive infinity
+ *
+ * The upper bound of the support is always positive infinity
* no matter the parameters.
*
* @return upper bound of the support (always Double.POSITIVE_INFINITY)
@@ -265,8 +265,8 @@ public class GammaDistributionImpl extends AbstractContinuousDistribution
/**
* {@inheritDoc}
- *
- * For shape parameter alpha
and scale
+ *
+ * For shape parameter alpha
and scale
* parameter beta
, the mean is
* alpha * beta
*
@@ -279,8 +279,8 @@ public class GammaDistributionImpl extends AbstractContinuousDistribution
/**
* {@inheritDoc}
- *
- * For shape parameter alpha
and scale
+ *
+ * For shape parameter alpha
and scale
* parameter beta
, the variance is
* alpha * beta^2
*
@@ -288,7 +288,7 @@ public class GammaDistributionImpl extends AbstractContinuousDistribution
*/
@Override
protected double calculateNumericalVariance() {
- final double b = getBeta();
+ final double b = getBeta();
return getAlpha() * b * b;
}
diff --git a/src/main/java/org/apache/commons/math/distribution/HypergeometricDistributionImpl.java b/src/main/java/org/apache/commons/math/distribution/HypergeometricDistributionImpl.java
index 0c7fb5ca1..8a934cc8c 100644
--- a/src/main/java/org/apache/commons/math/distribution/HypergeometricDistributionImpl.java
+++ b/src/main/java/org/apache/commons/math/distribution/HypergeometricDistributionImpl.java
@@ -287,10 +287,10 @@ public class HypergeometricDistributionImpl extends AbstractIntegerDistribution
/**
* {@inheritDoc}
- *
- * For population size N
,
- * number of successes m
, and
- * sample size n
,
+ *
+ * For population size N
,
+ * number of successes m
, and
+ * sample size n
,
* the lower bound of the support is
* max(0, n + m - N)
*
@@ -298,15 +298,15 @@ public class HypergeometricDistributionImpl extends AbstractIntegerDistribution
*/
@Override
public int getSupportLowerBound() {
- return FastMath.max(0,
+ return FastMath.max(0,
getSampleSize() + getNumberOfSuccesses() - getPopulationSize());
}
/**
* {@inheritDoc}
- *
- * For number of successes m
and
- * sample size n
,
+ *
+ * For number of successes m
and
+ * sample size n
,
* the upper bound of the support is
* min(m, n)
*
@@ -319,9 +319,9 @@ public class HypergeometricDistributionImpl extends AbstractIntegerDistribution
/**
* {@inheritDoc}
- *
- * For population size N
,
- * number of successes m
, and
+ *
+ * For population size N
,
+ * number of successes m
, and
* sample size n
, the mean is
* n * m / N
*
@@ -334,9 +334,9 @@ public class HypergeometricDistributionImpl extends AbstractIntegerDistribution
/**
* {@inheritDoc}
- *
- * For population size N
,
- * number of successes m
, and
+ *
+ * For population size N
,
+ * number of successes m
, and
* sample size n
, the variance is
* [ n * m * (N - n) * (N - m) ] / [ N^2 * (N - 1) ]
*
diff --git a/src/main/java/org/apache/commons/math/distribution/NormalDistributionImpl.java b/src/main/java/org/apache/commons/math/distribution/NormalDistributionImpl.java
index 3cb6735bb..cb230c8ce 100644
--- a/src/main/java/org/apache/commons/math/distribution/NormalDistributionImpl.java
+++ b/src/main/java/org/apache/commons/math/distribution/NormalDistributionImpl.java
@@ -244,8 +244,8 @@ public class NormalDistributionImpl extends AbstractContinuousDistribution
/**
* {@inheritDoc}
- *
- * The lower bound of the support is always negative infinity
+ *
+ * The lower bound of the support is always negative infinity
* no matter the parameters.
*
* @return lower bound of the support (always Double.NEGATIVE_INFINITY)
@@ -257,8 +257,8 @@ public class NormalDistributionImpl extends AbstractContinuousDistribution
/**
* {@inheritDoc}
- *
- * The upper bound of the support is always positive infinity
+ *
+ * The upper bound of the support is always positive infinity
* no matter the parameters.
*
* @return upper bound of the support (always Double.POSITIVE_INFINITY)
@@ -270,7 +270,7 @@ public class NormalDistributionImpl extends AbstractContinuousDistribution
/**
* {@inheritDoc}
- *
+ *
* For mean parameter mu
, the mean is mu
*
* @return {@inheritDoc}
@@ -282,8 +282,8 @@ public class NormalDistributionImpl extends AbstractContinuousDistribution
/**
* {@inheritDoc}
- *
- * For standard deviation parameter s
,
+ *
+ * For standard deviation parameter s
,
* the variance is s^2
*
* @return {@inheritDoc}
diff --git a/src/main/java/org/apache/commons/math/distribution/PascalDistributionImpl.java b/src/main/java/org/apache/commons/math/distribution/PascalDistributionImpl.java
index 61a0c4b09..df3554096 100644
--- a/src/main/java/org/apache/commons/math/distribution/PascalDistributionImpl.java
+++ b/src/main/java/org/apache/commons/math/distribution/PascalDistributionImpl.java
@@ -168,7 +168,7 @@ public class PascalDistributionImpl extends AbstractIntegerDistribution
/**
* {@inheritDoc}
- *
+ *
* The lower bound of the support is always 0 no matter the parameters.
*
* @return lower bound of the support (always 0)
@@ -180,10 +180,10 @@ public class PascalDistributionImpl extends AbstractIntegerDistribution
/**
* {@inheritDoc}
- *
- * The upper bound of the support is always positive infinity
- * no matter the parameters. Positive infinity is symbolised
- * by Integer.MAX_VALUE
together with
+ *
+ * The upper bound of the support is always positive infinity
+ * no matter the parameters. Positive infinity is symbolised
+ * by Integer.MAX_VALUE
together with
* {@link #isSupportUpperBoundInclusive()} being false
*
* @return upper bound of the support (always Integer.MAX_VALUE
for positive infinity)
@@ -195,8 +195,8 @@ public class PascalDistributionImpl extends AbstractIntegerDistribution
/**
* {@inheritDoc}
- *
- * For number of successes r
and
+ *
+ * For number of successes r
and
* probability of success p
, the mean is
* ( r * p ) / ( 1 - p )
*
@@ -211,8 +211,8 @@ public class PascalDistributionImpl extends AbstractIntegerDistribution
/**
* {@inheritDoc}
- *
- * For number of successes r
and
+ *
+ * For number of successes r
and
* probability of success p
, the mean is
* ( r * p ) / ( 1 - p )^2
*
@@ -225,7 +225,7 @@ public class PascalDistributionImpl extends AbstractIntegerDistribution
final double pInv = 1 - p;
return ( r * p ) / (pInv * pInv);
}
-
+
/**
* {@inheritDoc}
*/
diff --git a/src/main/java/org/apache/commons/math/distribution/PoissonDistributionImpl.java b/src/main/java/org/apache/commons/math/distribution/PoissonDistributionImpl.java
index 65cf10886..f48e94115 100644
--- a/src/main/java/org/apache/commons/math/distribution/PoissonDistributionImpl.java
+++ b/src/main/java/org/apache/commons/math/distribution/PoissonDistributionImpl.java
@@ -233,7 +233,7 @@ public class PoissonDistributionImpl extends AbstractIntegerDistribution
/**
* {@inheritDoc}
- *
+ *
* The lower bound of the support is always 0 no matter the mean parameter.
*
* @return lower bound of the support (always 0)
@@ -245,9 +245,9 @@ public class PoissonDistributionImpl extends AbstractIntegerDistribution
/**
* {@inheritDoc}
- *
- * The upper bound of the support is positive infinity,
- * regardless of the parameter values. There is no integer infinity,
+ *
+ * The upper bound of the support is positive infinity,
+ * regardless of the parameter values. There is no integer infinity,
* so this method returns Integer.MAX_VALUE
and
* {@link #isSupportUpperBoundInclusive()} returns true
.
*
@@ -260,7 +260,7 @@ public class PoissonDistributionImpl extends AbstractIntegerDistribution
/**
* {@inheritDoc}
- *
+ *
* For mean parameter p
, the mean is p
*
* @return {@inheritDoc}
@@ -272,7 +272,7 @@ public class PoissonDistributionImpl extends AbstractIntegerDistribution
/**
* {@inheritDoc}
- *
+ *
* For mean parameter p
, the variance is p
*
* @return {@inheritDoc}
@@ -281,7 +281,7 @@ public class PoissonDistributionImpl extends AbstractIntegerDistribution
protected double calculateNumericalVariance() {
return getMean();
}
-
+
/**
* {@inheritDoc}
*/
diff --git a/src/main/java/org/apache/commons/math/distribution/TDistributionImpl.java b/src/main/java/org/apache/commons/math/distribution/TDistributionImpl.java
index 851809d19..5fa37d2c5 100644
--- a/src/main/java/org/apache/commons/math/distribution/TDistributionImpl.java
+++ b/src/main/java/org/apache/commons/math/distribution/TDistributionImpl.java
@@ -202,8 +202,8 @@ public class TDistributionImpl
/**
* {@inheritDoc}
- *
- * The lower bound of the support is always negative infinity
+ *
+ * The lower bound of the support is always negative infinity
* no matter the parameters.
*
* @return lower bound of the support (always Double.NEGATIVE_INFINITY)
@@ -215,8 +215,8 @@ public class TDistributionImpl
/**
* {@inheritDoc}
- *
- * The upper bound of the support is always positive infinity
+ *
+ * The upper bound of the support is always positive infinity
* no matter the parameters.
*
* @return upper bound of the support (always Double.POSITIVE_INFINITY)
@@ -228,7 +228,7 @@ public class TDistributionImpl
/**
* {@inheritDoc}
- *
+ *
* For degrees of freedom parameter df, the mean is
*
*
df > 1
then 0
*
* df > 2
then df / (df - 2)
scale * Gamma(1 + (1 / shape))
* where Gamma(...)
is the Gamma-function
*
@@ -260,9 +260,9 @@ public class WeibullDistributionImpl extends AbstractContinuousDistribution
/**
* {@inheritDoc}
- *
- * The variance is
- * scale^2 * Gamma(1 + (2 / shape)) - mean^2
+ *
+ * The variance is
+ * scale^2 * Gamma(1 + (2 / shape)) - mean^2
* where Gamma(...)
is the Gamma-function
*
* @return {@inheritDoc}
@@ -273,7 +273,7 @@ public class WeibullDistributionImpl extends AbstractContinuousDistribution
final double sc = getScale();
final double mn = getNumericalMean();
- return (sc * sc) *
+ return (sc * sc) *
FastMath.exp(Gamma.logGamma(1 + (2 / sh))) -
(mn * mn);
}
diff --git a/src/main/java/org/apache/commons/math/distribution/ZipfDistributionImpl.java b/src/main/java/org/apache/commons/math/distribution/ZipfDistributionImpl.java
index 40e793017..4bfd824f8 100644
--- a/src/main/java/org/apache/commons/math/distribution/ZipfDistributionImpl.java
+++ b/src/main/java/org/apache/commons/math/distribution/ZipfDistributionImpl.java
@@ -150,19 +150,19 @@ public class ZipfDistributionImpl extends AbstractIntegerDistribution
/**
* {@inheritDoc}
- *
+ *
* The lower bound of the support is always 1 no matter the parameters.
*
* @return lower bound of the support (always 1)
*/
@Override
- public int getSupportLowerBound() {
+ public int getSupportLowerBound() {
return 1;
}
/**
* {@inheritDoc}
- *
+ *
* The upper bound of the support is the number of elements
*
* @return upper bound of the support
@@ -174,11 +174,11 @@ public class ZipfDistributionImpl extends AbstractIntegerDistribution
/**
* {@inheritDoc}
- *
+ *
* For number of elements N and exponent s, the mean is
- * Hs1 / Hs
where
+ * Hs1 / Hs
where
*
- *
*
@@ -188,7 +188,7 @@ public class ZipfDistributionImpl extends AbstractIntegerDistribution
protected double calculateNumericalMean() {
final int N = getNumberOfElements();
final double s = getExponent();
-
+
final double Hs1 = generalizedHarmonic(N, s - 1);
final double Hs = generalizedHarmonic(N, s);
@@ -197,22 +197,22 @@ public class ZipfDistributionImpl extends AbstractIntegerDistribution
/**
* {@inheritDoc}
- *
+ *
* For number of elements N and exponent s, the mean is
- * Hs1 = generalizedHarmonic(N, s - 1)
Hs1 = generalizedHarmonic(N, s - 1)
Hs = generalizedHarmonic(N, s)
(Hs2 / Hs) - (Hs1^2 / Hs^2)
where
+ * (Hs2 / Hs) - (Hs1^2 / Hs^2)
where
*
*
- *
+ *
* @return {@inheritDoc}
*/
@Override
protected double calculateNumericalVariance() {
final int N = getNumberOfElements();
final double s = getExponent();
-
+
final double Hs2 = generalizedHarmonic(N, s - 2);
final double Hs1 = generalizedHarmonic(N, s - 1);
final double Hs = generalizedHarmonic(N, s);
diff --git a/src/main/java/org/apache/commons/math/special/Erf.java b/src/main/java/org/apache/commons/math/special/Erf.java
index 5b8b1779b..c7023dce6 100644
--- a/src/main/java/org/apache/commons/math/special/Erf.java
+++ b/src/main/java/org/apache/commons/math/special/Erf.java
@@ -41,7 +41,7 @@ public class Erf {
* Hs2 = generalizedHarmonic(N, s - 2)
Hs1 = generalizedHarmonic(N, s - 1)
Hs1 = generalizedHarmonic(N, s - 1)
Hs = generalizedHarmonic(N, s)
@@ -70,11 +70,11 @@ public class Erf {
*
* Create a ResizableArray with the specified initial capacity @@ -302,7 +302,7 @@ public class ResizableDoubleArray implements DoubleArray, Serializable { contract(); } } - + /** * Adds several element to the end of this expandable array. *