edu.northwestern.at.utils.math.statistics
Class RankOrder

java.lang.Object
  extended by edu.northwestern.at.utils.math.statistics.RankOrder

public class RankOrder
extends java.lang.Object

RankOrder -- Convert columns of an (n x m) matrix to rank order values.


Constructor Summary
protected RankOrder()
          Don't allow instantiation, but allow subclassing.
 
Method Summary
static double[] getRankOrders(double[] values)
          Compute rank order for array of doubles.
static void rankOrder(Matrix matrix)
          Rank order columns of a matrix.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RankOrder

protected RankOrder()
Don't allow instantiation, but allow subclassing.

Method Detail

rankOrder

public static void rankOrder(Matrix matrix)
Rank order columns of a matrix.

Parameters:
matrix - The n x m data matrix whose columns are to be rank ordered.

On return, the columns of the input matrix are independently converted to rank order.


getRankOrders

public static double[] getRankOrders(double[] values)
Compute rank order for array of doubles.

Parameters:
values - Values to be rank ordered.
Returns:
The input values are converted to rank order values, and the return value is set the the values array as well.

Tied ranks are converted to mid-rank values. This allow for proper computation of various rank-based statistics, e.g., Spearman's correlation coefficient.