MOEA Framework 2.12
API Specification

org.moeaframework.util.statistics
Class OrdinalStatisticalTest

java.lang.Object
  extended by org.moeaframework.util.statistics.OrdinalStatisticalTest
All Implemented Interfaces:
StatisticalTest
Direct Known Subclasses:
KruskalWallisTest, MannWhitneyUTest, WilcoxonSignedRanksTest

public abstract class OrdinalStatisticalTest
extends Object
implements StatisticalTest

Abstract class for implementing ordinal (rank-based) statistical tests. Methods are provided for storing RankedObservation objects and updating their ranks.


Field Summary
protected  Comparator<RankedObservation> comparator
          The comparator used for ordering observations.
protected  List<RankedObservation> data
          Collection of all ranked observations added to this test.
protected  int numberOfGroups
          The number of groups being tested.
 
Constructor Summary
OrdinalStatisticalTest(int numberOfGroups)
          Constructs a new ordinal (rank-based) statistical test for the specified number of groups.
OrdinalStatisticalTest(int numberOfGroups, Comparator<RankedObservation> comparator)
          Constructs a new ordinal (rank-based) statistical test for the specified number of groups and the comparator for ordering observations.
 
Method Summary
protected  void add(double value, int group)
          Adds a new observation with the specified value and group.
protected  void addAll(double[] values, int group)
          Adds several new observations to the specified group.
 Comparator<RankedObservation> getComparator()
          Returns the comparator used by this test to order observations.
 int getNumberOfGroups()
          Returns the number of groups being tested.
 int size()
          Returns the number of observations used in this test.
protected  void update()
          Sorts the observations using the comparator and assigns ranks.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.moeaframework.util.statistics.StatisticalTest
test
 

Field Detail

numberOfGroups

protected final int numberOfGroups
The number of groups being tested.


comparator

protected final Comparator<RankedObservation> comparator
The comparator used for ordering observations.


data

protected final List<RankedObservation> data
Collection of all ranked observations added to this test.

Constructor Detail

OrdinalStatisticalTest

public OrdinalStatisticalTest(int numberOfGroups)
Constructs a new ordinal (rank-based) statistical test for the specified number of groups.

Parameters:
numberOfGroups - the number of groups being tested

OrdinalStatisticalTest

public OrdinalStatisticalTest(int numberOfGroups,
                              Comparator<RankedObservation> comparator)
Constructs a new ordinal (rank-based) statistical test for the specified number of groups and the comparator for ordering observations.

Parameters:
numberOfGroups - the number of groups being tested
comparator - the comparator for ordering observations
Method Detail

add

protected void add(double value,
                   int group)
Adds a new observation with the specified value and group.

Parameters:
value - the value of the new observation
group - the group to which the new observation belongs

addAll

protected void addAll(double[] values,
                      int group)
Adds several new observations to the specified group.

Parameters:
values - the values of the new observations
group - the group to which the new observations belong

update

protected void update()
Sorts the observations using the comparator and assigns ranks.


size

public int size()
Returns the number of observations used in this test.

Returns:
the number of observations used in this test

getNumberOfGroups

public int getNumberOfGroups()
Returns the number of groups being tested.

Returns:
the number of groups being tested

getComparator

public Comparator<RankedObservation> getComparator()
Returns the comparator used by this test to order observations.

Returns:
the comparator used by this test to order observations

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!