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. + *
+ * Returns Double.NaN if no data values have been added and
+ * returns 0 if there is just one value in the data set.
+ * + * @since 2.0 + */ + public double getSecondMoment() { + return secondMoment.getResult(); + } /** * Generates a text report displaying summary statistics from values that