Uploaded image for project: 'Commons Math'
  1. Commons Math
  2. MATH-1178

Incorrect sample of usage of StatUtils at homepage

    XMLWordPrintableJSON

Details

    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));"

      Attachments

        Activity

          People

            Unassigned Unassigned
            zimy Dmitriy
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - 10m
                10m
                Remaining:
                Remaining Estimate - 10m
                10m
                Logged:
                Time Spent - Not Specified
                Not Specified