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

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `static double` | `count​(double[] a, double[] b)` | How many pairs (i,j) exist where a[i] < b[j]? Ties are counted as 0.5.
    `static void` | `main​(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 void` | `test1​(String[] argv)` |
    `static void` | `test2​(String[] argv)` |
    `static double[]` | `topEigenVector​(double[][] a)` | Given a dense matrix with positive elements, find the eigenvector corresponding to the largest eigenvalue.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### MannWhitney

          public MannWhitney()

  - ### Method Detail

    - #### 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 sorted
        `b` - 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

          public static void test1​(String[] argv)

      Parameters:
        `argv` - a,b,c,d e,f,g

    - #### test2

          public static void test2​(String[] argv)

      Parameters:
        `argv` - a,b,c,d e,f,g h,i,j,k,l ....

    - #### main

          public static void main​(String[] argv)