commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dmitriy (JIRA)" <>
Subject [jira] [Created] (MATH-1178) Incorrect sample of usage of StatUtils at homepage
Date Mon, 08 Dec 2014 22:59:12 GMT
Dmitriy created MATH-1178:

             Summary: Incorrect sample of usage of StatUtils at homepage
                 Key: MATH-1178
             Project: Commons Math
          Issue Type: Bug
         Environment: Documentation at
            Reporter: Dmitriy
            Priority: Trivial

At 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

View raw message