diff --git a/src/java/org/apache/commons/math/stat/univariate/moment/FirstMoment.java b/src/java/org/apache/commons/math/stat/univariate/moment/FirstMoment.java index 45973fd2f..71ec55383 100644 --- a/src/java/org/apache/commons/math/stat/univariate/moment/FirstMoment.java +++ b/src/java/org/apache/commons/math/stat/univariate/moment/FirstMoment.java @@ -34,8 +34,10 @@ import org.apache.commons.math.stat.univariate.AbstractStorelessUnivariateStatis *
m = m + (new value - m) / (number of observations)
+ * Returns Double.NaN
if the dataset is empty.
*
- * @version $Revision: 1.16 $ $Date: 2004/06/27 19:37:51 $
+ * @version $Revision: 1.17 $ $Date: 2004/06/29 02:14:17 $
*/
public class FirstMoment extends AbstractStorelessUnivariateStatistic implements Serializable{
diff --git a/src/java/org/apache/commons/math/stat/univariate/moment/FourthMoment.java b/src/java/org/apache/commons/math/stat/univariate/moment/FourthMoment.java
index d06d7cbc7..fe59b4032 100644
--- a/src/java/org/apache/commons/math/stat/univariate/moment/FourthMoment.java
+++ b/src/java/org/apache/commons/math/stat/univariate/moment/FourthMoment.java
@@ -38,8 +38,11 @@ import java.io.Serializable;
*
* new value = old value - 4 * (dev/n) * m3 + 6 * (dev/n)^2 * m2 +
* [n^2 - 3 * (n-1)] * dev^4 * (n-1) / n^3
+ *
+ * Returns Double.NaN
if no data values have been added and
+ * returns 0
if there is just one value in the data set.
*
- * @version $Revision: 1.18 $ $Date: 2004/06/27 19:37:51 $
+ * @version $Revision: 1.19 $ $Date: 2004/06/29 02:14:17 $
*/
public class FourthMoment extends ThirdMoment implements Serializable{
diff --git a/src/java/org/apache/commons/math/stat/univariate/moment/SecondMoment.java b/src/java/org/apache/commons/math/stat/univariate/moment/SecondMoment.java
index 409bfcbb4..a1ba873f0 100644
--- a/src/java/org/apache/commons/math/stat/univariate/moment/SecondMoment.java
+++ b/src/java/org/apache/commons/math/stat/univariate/moment/SecondMoment.java
@@ -30,8 +30,11 @@ import java.io.Serializable;
* Then
*
* new value = old value + dev^2 * (n -1) / n. + *
+ * Returns Double.NaN
if no data values have been added and
+ * returns 0
if there is just one value in the data set.
*
- * @version $Revision: 1.17 $ $Date: 2004/06/27 19:37:51 $
+ * @version $Revision: 1.18 $ $Date: 2004/06/29 02:14:17 $
*/
public class SecondMoment extends FirstMoment implements Serializable {
diff --git a/src/java/org/apache/commons/math/stat/univariate/moment/ThirdMoment.java b/src/java/org/apache/commons/math/stat/univariate/moment/ThirdMoment.java
index ea49d09af..bc6951b56 100644
--- a/src/java/org/apache/commons/math/stat/univariate/moment/ThirdMoment.java
+++ b/src/java/org/apache/commons/math/stat/univariate/moment/ThirdMoment.java
@@ -31,8 +31,11 @@ import java.io.Serializable;
* Then
*
* new value = old value - 3 * (dev/n) * m2 + (n-1) * (n -2) * (dev^3/n^2) + *
+ * Returns Double.NaN
if no data values have been added and
+ * returns 0
if there is just one value in the data set.
*
- * @version $Revision: 1.17 $ $Date: 2004/06/27 19:37:51 $
+ * @version $Revision: 1.18 $ $Date: 2004/06/29 02:14:17 $
*/
public class ThirdMoment extends SecondMoment implements Serializable {