public class Rank extends Object
Constructor and Description |
---|
Rank() |
Modifier and Type | Method and Description |
---|---|
static cern.colt.list.IntArrayList |
order(cern.colt.list.DoubleArrayList array)
Return a permutation which puts the array in sorted order.
|
static long |
rankSum(List<Double> ranks) |
static cern.colt.list.DoubleArrayList |
rankTransform(cern.colt.list.DoubleArrayList array)
Rank transform an array.
|
static cern.colt.list.DoubleArrayList |
rankTransform(cern.colt.list.DoubleArrayList array,
boolean descending)
Rank transform an array.
|
static <K> Map<K,Double> |
rankTransform(Map<K,? extends Comparable<?>> m)
Rank transform a map, where the values are Comparable values we wish to rank.
|
static <K> Map<K,Double> |
rankTransform(Map<K,? extends Comparable<?>> m,
boolean desc)
Ties are broken as for the other methods.
|
public static cern.colt.list.IntArrayList order(cern.colt.list.DoubleArrayList array)
array
- public static cern.colt.list.DoubleArrayList rankTransform(cern.colt.list.DoubleArrayList array)
Ties are resolved by assigning the average rank for tied values. For example, instead of arbitrarily assigning ties ranks 3,4,5, all three values would get a rank of 4 and no value would get a rank of 3 or 5.
Missing values are sorted in their natural order, which means they end up all at one end (at the high ('bad') end)
array
- DoubleArrayListarray,
- or null if the ranks could not be computed.public static cern.colt.list.DoubleArrayList rankTransform(cern.colt.list.DoubleArrayList array, boolean descending)
Ties are resolved by assigning the average rank for tied values. For example, instead of arbitrarily assigning ties ranks 3,4,5, all three values would get a rank of 4 and no value would get a rank of 3 or 5.
Missing values are sorted in their natural order, which means they end up all at one end (at the high ('bad') end)
array
- DoubleArrayListdescending
- - reverse the usual ordering so larger values are the the front.public static <K> Map<K,Double> rankTransform(Map<K,? extends Comparable<?>> m)
Missing values are sorted in their natural order, which means they end up all at one end (at the high ('bad') end)
m
- java.util.Map with keys Objects, values Doubles.public static <K> Map<K,Double> rankTransform(Map<K,? extends Comparable<?>> m, boolean desc)
Missing values are sorted in their natural order, which means they end up all at one end (at the high ('bad') end)
K
- m
- desc
- if true, the lowest (first) rank will be for the highest value.Copyright © 2003–2023 UBC Michael Smith Laboratories. All rights reserved.