Package edu.wisc.game.math
Class MannWhitney
java.lang.Object
edu.wisc.game.math.MannWhitney
public class MannWhitney extends Object
The Mann-Whitney math
-
Constructor Summary
Constructors Constructor Description MannWhitney() -
Method Summary
Modifier and Type Method Description static doublecount(double[] a, double[] b)How many pairs (i,j) exist where a[i] < b[j]? Ties are counted as 0.5.static voidmain(String[] argv)static double[][]ratioMatrix(double[][] z)static double[][]rawMatrix(double[][] a)The element z[i][j] of the results is equal to the number of pairs (k,m) such that a[i][k] < a[j][m].static voidtest1(String[] argv)static voidtest2(String[] argv)static double[]topEigenVector(double[][] a)Given a dense matrix with positive elements, find the eigenvector corresponding to the largest eigenvalue.
-
Constructor Details
-
MannWhitney
public MannWhitney()
-
-
Method Details
-
count
public static double count(double[] a, double[] b)How many pairs (i,j) exist where a[i] < b[j]? Ties are counted as 0.5.- Parameters:
a- Ascending sortedb- Ascending sorted
-
rawMatrix
public static double[][] rawMatrix(double[][] a)The element z[i][j] of the results is equal to the number of pairs (k,m) such that a[i][k] < a[j][m].- Parameters:
a- Each row of this matrix represent a "cloud" of points to be compared. It will be sorted.
-
ratioMatrix
public static double[][] ratioMatrix(double[][] z)- Parameters:
z- The raw matrix- Returns:
- w[i][j] = (z[i][j]+1)/(z[j][i]+1)
-
topEigenVector
public static double[] topEigenVector(double[][] a)Given a dense matrix with positive elements, find the eigenvector corresponding to the largest eigenvalue. By Perron-Frobenius theorem, we know that such a vector exists, and is composed of positive elements. -
test1
- Parameters:
argv- a,b,c,d e,f,g
-
test2
- Parameters:
argv- a,b,c,d e,f,g h,i,j,k,l ....
-
main
-