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

Add mode function to StatUtils class

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.3
    • Labels:
      None

      Description

      It might be useful to have a StatUtils function to get the mode.

      However, this may be tricky as it does not easily fit in with the current StatUtils design.

      The mode can have multiple elements, but all the other methods only return a single value.

      There are at least two options for converting an array to a single value:

      • arbitrarily (or randomly) pick one
      • throw an Exception if there is more than one mode

      Or maybe StatUtils should return a double array.

      StatUtils also uses nested classes for all but the difference and normalize methods. However the standard interfaces and classes don't support returning arrays.

        Attachments

        1. MATH-1007.patch
          4 kB
          Sebb
        2. MATH-1007t.patch
          2 kB
          Phil Steitz

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                sebb Sebb
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: