Repository: commons-math
Updated Branches:
  refs/heads/master 9085dfacc -> b2627dacc


Fixed errors / omissions in javadoc regarding NaN return values. JIRA: 
MATH-1296.


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

Branch: refs/heads/master
Commit: b2627daccef8f41e83649d085268dc247b3fbb3f
Parents: 9085dfa
Author: Phil Steitz <phil.ste...@gmail.com>
Authored: Wed Dec 2 20:34:49 2015 -0700
Committer: Phil Steitz <phil.ste...@gmail.com>
Committed: Wed Dec 2 20:34:49 2015 -0700

----------------------------------------------------------------------
 .../stat/descriptive/DescriptiveStatistics.java    | 17 ++++++++++-------
 .../math4/stat/descriptive/moment/Skewness.java    |  5 +++++
 2 files changed, 15 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-math/blob/b2627dac/src/main/java/org/apache/commons/math4/stat/descriptive/DescriptiveStatistics.java
----------------------------------------------------------------------
diff --git 
a/src/main/java/org/apache/commons/math4/stat/descriptive/DescriptiveStatistics.java
 
b/src/main/java/org/apache/commons/math4/stat/descriptive/DescriptiveStatistics.java
index d6dfca1..99e02cc 100644
--- 
a/src/main/java/org/apache/commons/math4/stat/descriptive/DescriptiveStatistics.java
+++ 
b/src/main/java/org/apache/commons/math4/stat/descriptive/DescriptiveStatistics.java
@@ -208,9 +208,12 @@ public class DescriptiveStatistics implements 
StatisticalSummary, Serializable {
 
     /**
      * Returns the <a href="http://www.xycoon.com/geometric_mean.htm";>
-     * geometric mean </a> of the available values
+     * geometric mean </a> of the available values.
+     * <p>
+     * See {@link GeometricMean} for details on the computing algorithm.</p>
+     *
      * @return The geometricMean, Double.NaN if no values have been added,
-     * or if the product of the available values is less than or equal to 0.
+     * or if any negative values have been added.
      */
     public double getGeometricMean() {
         return apply(geometricMeanImpl);
@@ -275,8 +278,8 @@ public class DescriptiveStatistics implements 
StatisticalSummary, Serializable {
     /**
      * Returns the skewness of the available values. Skewness is a
      * measure of the asymmetry of a given distribution.
-     * @return The skewness, Double.NaN if no values have been added
-     * or 0.0 for a value set &lt;=2.
+     *
+     * @return The skewness, Double.NaN if less than 3 values have been added.
      */
     public double getSkewness() {
         return apply(skewnessImpl);
@@ -284,9 +287,9 @@ public class DescriptiveStatistics implements 
StatisticalSummary, Serializable {
 
     /**
      * Returns the Kurtosis of the available values. Kurtosis is a
-     * measure of the "peakedness" of a distribution
-     * @return The kurtosis, Double.NaN if no values have been added, or 0.0
-     * for a value set &lt;=3.
+     * measure of the "peakedness" of a distribution.
+     *
+     * @return The kurtosis, Double.NaN if less than 4 values have been added.
      */
     public double getKurtosis() {
         return apply(kurtosisImpl);

http://git-wip-us.apache.org/repos/asf/commons-math/blob/b2627dac/src/main/java/org/apache/commons/math4/stat/descriptive/moment/Skewness.java
----------------------------------------------------------------------
diff --git 
a/src/main/java/org/apache/commons/math4/stat/descriptive/moment/Skewness.java 
b/src/main/java/org/apache/commons/math4/stat/descriptive/moment/Skewness.java
index 8dca668..93a7f7f 100644
--- 
a/src/main/java/org/apache/commons/math4/stat/descriptive/moment/Skewness.java
+++ 
b/src/main/java/org/apache/commons/math4/stat/descriptive/moment/Skewness.java
@@ -35,6 +35,11 @@ import org.apache.commons.math4.util.MathUtils;
  * where n is the number of values, mean is the {@link Mean} and std is the
  * {@link StandardDeviation} </p>
  * <p>
+ * Note that this statistic is undefined for n < 3.  <code>Double.Nan</code>
+ * is returned when there is not sufficient data to compute the statistic.
+ * Double.NaN may also be returned if the input includes NaN and / or
+ * infinite values.</p>
+ * <p>
  * <strong>Note that this implementation is not synchronized.</strong> If
  * multiple threads access an instance of this class concurrently, and at least
  * one of the threads invokes the <code>increment()</code> or

Reply via email to