[
https://issues.apache.org/jira/browse/MATH-568?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Luc Maisonobe resolved MATH-568.
--------------------------------
Resolution: Fixed
Fix Version/s: 3.0
Fixed in subversion repository as of r1132437.
Thanks for the report and the patch.
> Code in Userguide for Statistics wrong or deprecated
> -----------------------------------------------------
>
> Key: MATH-568
> URL: https://issues.apache.org/jira/browse/MATH-568
> Project: Commons Math
> Issue Type: Improvement
> Affects Versions: 2.2
> Environment: windows 7
> Reporter: Christoph M. Friedrich
> Priority: Trivial
> Labels: documentation
> Fix For: 3.0
>
> Original Estimate: 0.05h
> Remaining Estimate: 0.05h
>
> The code for the Statistics examples is not running and can easily be fixed.
> Example:
> // Get a DescriptiveStatistics instance
> DescriptiveStatistics stats = new DescriptiveStatistics();
> // Add the data from the array
> for( int i = 0; i < inputArray.length; i++) {
> stats.addValue(inputArray[i]);
> }
> // Compute some statistics
> double mean = stats.getMean();
> double std = stats.getStandardDeviation();
> double median = stats.getMedian();
> Fails with getMedian not found, change to getPercentile(50);
> The second Codeexample for StatuUtils states:
> // Compute statistics directly from the array
> // assume values is a double[] array
> double mean = StatUtils.mean(values);
> double std = StatUtils.variance(values);
> double median = StatUtils.percentile(50);
> the last line needs to be changed to: double median =
> StatUtils.percentile(values,50);
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira