[ 
https://issues.apache.org/jira/browse/MATH-1007?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Sebb resolved MATH-1007.
------------------------

       Resolution: Fixed
    Fix Version/s: 3.3

Tests found bug in static double[] getMode method - had forgotten to increment 
the array index. Oops!

URL: http://svn.apache.org/r1504495
Log:
MATH-1007 Add mode function to StatUtils class

Modified:
    commons/proper/math/trunk/src/changes/changes.xml
    
commons/proper/math/trunk/src/main/java/org/apache/commons/math3/stat/StatUtils.java
    
commons/proper/math/trunk/src/test/java/org/apache/commons/math3/stat/StatUtilsTest.java

                
> Add mode function to StatUtils class
> ------------------------------------
>
>                 Key: MATH-1007
>                 URL: https://issues.apache.org/jira/browse/MATH-1007
>             Project: Commons Math
>          Issue Type: New Feature
>            Reporter: Sebb
>             Fix For: 3.3
>
>         Attachments: MATH-1007.patch, MATH-1007t.patch
>
>
> 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.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to