Class RankSumPdf


  • public class RankSumPdf
    extends java.lang.Object
    Calculate rank sum probability distribution function (pdf) and cumulative distribution function (cdf). Note: This class assumes that ranks can be repeated (selecting with replacement)
    Author:
    Pablo Cingolani
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static org.apfloat.Apfloat BAD  
      static int CACHE_MAX_N
      Cache size roughly (N * NT)^2
      static int CACHE_MAX_NT  
      static double SMALL
      A small number
    • Constructor Summary

      Constructors 
      Constructor Description
      RankSumPdf()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static boolean canBeCached​(int n, int nt)
      Is the number in the cache
      static org.apfloat.Apfloat cdf​(int n, int nt, int r)
      Cumulative density function (cdf)
      static org.apfloat.Apfloat cdfNormal​(int n, int nt, int r)
      Normal approximation to rankSum CDF
      static boolean isOk​(org.apfloat.Apfloat p)
      Is the value OK? (i.e.
      static void main​(java.lang.String[] args)  
      static long maxRankSum​(int n, int nt)
      Maximum possible rank sum
      static double mean​(int n, int nt)
      Mean value for a given N and N_T
      static long minRankSum​(int n, int nt)
      Minimum possible rank sum
      static org.apfloat.Apfloat pdf​(int n, int nt, int r)
      Probability density function (pdf)
      static org.apfloat.Apfloat pdfNormal​(int n, int nt, int r)
      Normal approximation to rank sum statistic
      static double sigma​(int n, int nt)
      Wrapper to Sqrt(variance)
      static double variance​(int n, int nt)
      Variance for a given N and N_T
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • CACHE_MAX_N

        public static final int CACHE_MAX_N
        Cache size roughly (N * NT)^2
        See Also:
        Constant Field Values
      • BAD

        public static final org.apfloat.Apfloat BAD
      • SMALL

        public static double SMALL
        A small number
    • Constructor Detail

      • RankSumPdf

        public RankSumPdf()
    • Method Detail

      • canBeCached

        public static boolean canBeCached​(int n,
                                          int nt)
        Is the number in the cache
        Returns:
        true if it is
      • cdf

        public static org.apfloat.Apfloat cdf​(int n,
                                              int nt,
                                              int r)
        Cumulative density function (cdf)
        Parameters:
        n - : Maximum rank number
        nt - : Number of elements in the sum
        r - : rank sum value
        Returns:
        The probability that selecting 'nt' elements out of 'n' ranked elements, the rank sum is less or equal to 'r'
      • cdfNormal

        public static org.apfloat.Apfloat cdfNormal​(int n,
                                                    int nt,
                                                    int r)
        Normal approximation to rankSum CDF
        Parameters:
        n - : Maximum rank number
        nt - : Number of elements in the sum
        r - : rank sum value
        Returns:
        The probability that selecting 'nt' elements out of 'n' ranked elements, the rank sum is less or equal to 'r'
      • isOk

        public static boolean isOk​(org.apfloat.Apfloat p)
        Is the value OK? (i.e. not 'BAD')
        Parameters:
        p -
        Returns:
      • main

        public static void main​(java.lang.String[] args)
      • maxRankSum

        public static long maxRankSum​(int n,
                                      int nt)
        Maximum possible rank sum
        Parameters:
        n -
        nt -
        Returns:
      • mean

        public static double mean​(int n,
                                  int nt)
        Mean value for a given N and N_T
        Parameters:
        n -
        nt -
        Returns:
      • minRankSum

        public static long minRankSum​(int n,
                                      int nt)
        Minimum possible rank sum
        Parameters:
        n -
        nt -
        Returns:
      • pdf

        public static org.apfloat.Apfloat pdf​(int n,
                                              int nt,
                                              int r)
        Probability density function (pdf)
        Parameters:
        n - : Maximum rank number
        nt - : Number of elements in the sum
        r - : rank sum value
        Returns:
        The probability that selecting 'nt' elements out of 'n' ranked elements, the rank sum is equal to 'r'
      • pdfNormal

        public static org.apfloat.Apfloat pdfNormal​(int n,
                                                    int nt,
                                                    int r)
        Normal approximation to rank sum statistic
        Parameters:
        n - : Maximum rank number
        nt - : Number of elements in the sum
        r - : rank sum value
        Returns:
        The probability that selecting 'nt' elements out of 'n' ranked elements, the rank sum is equal to 'r'
      • sigma

        public static double sigma​(int n,
                                   int nt)
        Wrapper to Sqrt(variance)
        Parameters:
        n -
        nt -
        Returns:
      • variance

        public static double variance​(int n,
                                      int nt)
        Variance for a given N and N_T
        Parameters:
        n -
        nt -
        Returns: