You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by lu...@apache.org on 2011/06/05 17:41:50 UTC
svn commit: r1132437 - in /commons/proper/math/trunk/src/site/xdoc:
changes.xml userguide/stat.xml
Author: luc
Date: Sun Jun 5 15:41:50 2011
New Revision: 1132437
URL: http://svn.apache.org/viewvc?rev=1132437&view=rev
Log:
Fixed documentation of statistics examples.
JIRA: MATH-568
Modified:
commons/proper/math/trunk/src/site/xdoc/changes.xml
commons/proper/math/trunk/src/site/xdoc/userguide/stat.xml
Modified: commons/proper/math/trunk/src/site/xdoc/changes.xml
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/site/xdoc/changes.xml?rev=1132437&r1=1132436&r2=1132437&view=diff
==============================================================================
--- commons/proper/math/trunk/src/site/xdoc/changes.xml (original)
+++ commons/proper/math/trunk/src/site/xdoc/changes.xml Sun Jun 5 15:41:50 2011
@@ -52,6 +52,9 @@ The <action> type attribute can be add,u
If the output is not quite correct, check for invisible trailing spaces!
-->
<release version="3.0" date="TBD" description="TBD">
+ <action dev="luc" type="fix" issue="MATH-568" due-to="Christoph M. Friedrich">
+ Fixed documentation of statistics examples.
+ </action>
<action dev="luc" type="fix" issue="MATH-507" due-to="Ole Ersoy">
Improved documentation of general optimization with a thorough example.
</action>
Modified: commons/proper/math/trunk/src/site/xdoc/userguide/stat.xml
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/site/xdoc/userguide/stat.xml?rev=1132437&r1=1132436&r2=1132437&view=diff
==============================================================================
--- commons/proper/math/trunk/src/site/xdoc/userguide/stat.xml (original)
+++ commons/proper/math/trunk/src/site/xdoc/userguide/stat.xml Sun Jun 5 15:41:50 2011
@@ -169,7 +169,7 @@ for( int i = 0; i < inputArray.length
// Compute some statistics
double mean = stats.getMean();
double std = stats.getStandardDeviation();
-double median = stats.getMedian();
+double median = stats.getPercentile(50);
</source>
</dd>
<dd>Using the <code>SummaryStatistics</code> aggregate (values are
@@ -198,7 +198,7 @@ double std = stats.getStandardDeviation(
// assume values is a double[] array
double mean = StatUtils.mean(values);
double std = StatUtils.variance(values);
-double median = StatUtils.percentile(50);
+double median = StatUtils.percentile(values, 50);
// Compute the mean of the first three values in the array
mean = StatUtils.mean(values, 0, 3);