commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pste...@apache.org
Subject svn commit: r791685 - /commons/proper/math/trunk/src/java/org/apache/commons/math/stat/descriptive/SummaryStatistics.java
Date Tue, 07 Jul 2009 03:01:34 GMT
Author: psteitz
Date: Tue Jul  7 03:01:34 2009
New Revision: 791685

URL: http://svn.apache.org/viewvc?rev=791685&view=rev
Log:
Exposed second moment.

Modified:
    commons/proper/math/trunk/src/java/org/apache/commons/math/stat/descriptive/SummaryStatistics.java

Modified: commons/proper/math/trunk/src/java/org/apache/commons/math/stat/descriptive/SummaryStatistics.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/java/org/apache/commons/math/stat/descriptive/SummaryStatistics.java?rev=791685&r1=791684&r2=791685&view=diff
==============================================================================
--- commons/proper/math/trunk/src/java/org/apache/commons/math/stat/descriptive/SummaryStatistics.java
(original)
+++ commons/proper/math/trunk/src/java/org/apache/commons/math/stat/descriptive/SummaryStatistics.java
Tue Jul  7 03:01:34 2009
@@ -283,6 +283,21 @@
     public double getSumOfLogs() {
         return sumLogImpl.getResult();
     }
+    
+    /**
+     * Returns a statistic related to the Second Central Moment.  Specifically,
+     * what is returned is the sum of squared deviations from the sample mean
+     * among the values that have been added.
+     * <p>
+     * Returns <code>Double.NaN</code> if no data values have been added and
+     * returns <code>0</code> if there is just one value in the data set.</p>
+     * <p>
+     * 
+     * @since 2.0
+     */
+    public double getSecondMoment() {
+        return secondMoment.getResult();
+    }
 
     /**
      * Generates a text report displaying summary statistics from values that



Mime
View raw message