Details
-
Bug
-
Status: Closed
-
Trivial
-
Resolution: Fixed
-
None
-
None
-
None
-
Documentation at http://commons.apache.org/proper/commons-math/userguide/stat.html
Description
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));"