MOEA Framework 2.12
API Specification

org.moeaframework.util.statistics
Class MannWhitneyUTest

java.lang.Object
  extended by org.moeaframework.util.statistics.OrdinalStatisticalTest
      extended by org.moeaframework.util.statistics.MannWhitneyUTest
All Implemented Interfaces:
StatisticalTest

public class MannWhitneyUTest
extends OrdinalStatisticalTest

The Mann-Whitney U test determines if two populations have different medians.

Assumptions:

  1. Samples are randomly selected from their corresponding populations
  2. Samples are independent
  3. The dependent variable (value being sampled) is continuous
  4. The underlying distributions of the populations are identical in shape

References:

  1. Sheskin, D.J. "Handbook of Parametric and Nonparametric Statistical Procedures, Third Edition." Chapman & Hall/CRC. 2004.


Field Summary
 
Fields inherited from class org.moeaframework.util.statistics.OrdinalStatisticalTest
comparator, data, numberOfGroups
 
Constructor Summary
MannWhitneyUTest()
          Constructs a Mann-Whitney U test.
 
Method Summary
 void add(double value, int group)
          Adds a new observation with the specified value and group.
 void addAll(double[] values, int group)
          Adds several new observations to the specified group.
 boolean test(double alpha)
          Returns true if the null hypothesis is rejected; false otherwise.
 
Methods inherited from class org.moeaframework.util.statistics.OrdinalStatisticalTest
getComparator, getNumberOfGroups, size, update
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MannWhitneyUTest

public MannWhitneyUTest()
Constructs a Mann-Whitney U test.

Method Detail

add

public void add(double value,
                int group)
Description copied from class: OrdinalStatisticalTest
Adds a new observation with the specified value and group.

Overrides:
add in class OrdinalStatisticalTest
Parameters:
value - the value of the new observation
group - the group to which the new observation belongs

addAll

public void addAll(double[] values,
                   int group)
Description copied from class: OrdinalStatisticalTest
Adds several new observations to the specified group.

Overrides:
addAll in class OrdinalStatisticalTest
Parameters:
values - the values of the new observations
group - the group to which the new observations belong

test

public boolean test(double alpha)
Returns true if the null hypothesis is rejected; false otherwise. The meaning of the null hypothesis and alternative hypothesis depends on the specific test.

The prespecified level of confidence, alpha, can be used for either one-tailed or two-tailed (directional or nondirectional) distributions, depending on the specific test. Some tests may only support specific values for alpha.

When the samples from both populations are less than 20, only alpha values of 0.05 and 0.01 are valid. This is because a table is used to accurately determine the critical values. When more than 20 samples are available, the normal approximation is used allowing any value for alpha.

Parameters:
alpha - the prespecified level of confidence
Returns:
true if the null hypothesis is rejected; false otherwise
Throws:
IllegalArgumentException - if an insufficient sampling size is provided, or if an invalid alpha value is provided

MOEA Framework 2.12
API Specification

Copyright 2009-2016 MOEA Framework. All rights reserved.
Licensed under the GNU Lesser General Public License.
Return to the MOEA Framework homepage. Visit us on Github!