Apache Commons logo Apache Commons Statistics

Apache Commons Statistics: Ranking

Apache Commons Statistics provides statistical rank transformations.

Example:

import org.apache.commons.statistics.ranking.NaturalRanking;

NaturalRanking ranking = new NaturalRanking();
ranking.apply(new double[] {5, 6, 7, 8});   // 1, 2, 3, 4
ranking.apply(new double[] {8, 5, 7, 6});   // 4, 1, 3, 2
ranking.apply(new double[] {6, 5, 6, 7});   // 2.5, 1, 2.5, 4

Browse the Javadoc for more information.