Dmitriy created MATH-1178:
-----------------------------

             Summary: Incorrect sample of usage of StatUtils at homepage
                 Key: MATH-1178
                 URL: https://issues.apache.org/jira/browse/MATH-1178
             Project: Commons Math
          Issue Type: Bug
         Environment: Documentation at 
http://commons.apache.org/proper/commons-math/userguide/stat.html
            Reporter: Dmitriy
            Priority: Trivial


At http://commons.apache.org/proper/commons-math/userguide/stat.html you are 
providing three ways to compute mean, std, median with DescriptiveStatistics, 
SummaryStatistics, StatUtils.
But when you execute double std = StatUtils.variance(values), you are not 
actually get std in std, you get std*std, because DescriptiveStatistics 
actually returns FastMath.sqrt(getVariance()), but StatUtils returns variance 
directly.

The solution is to substitute "double std = StatUtils.variance(values);" with 
"double std = FastMath.sqrt(StatUtils.variance(values));"




--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to