Package org.snpeff.probablility
Class RankSumPdf
- java.lang.Object
-
- org.snpeff.probablility.RankSumPdf
-
public class RankSumPdf extends java.lang.ObjectCalculate 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.ApfloatBADstatic intCACHE_MAX_NCache size roughly (N * NT)^2static intCACHE_MAX_NTstatic doubleSMALLA small number
-
Constructor Summary
Constructors Constructor Description RankSumPdf()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static booleancanBeCached(int n, int nt)Is the number in the cachestatic org.apfloat.Apfloatcdf(int n, int nt, int r)Cumulative density function (cdf)static org.apfloat.ApfloatcdfNormal(int n, int nt, int r)Normal approximation to rankSum CDFstatic booleanisOk(org.apfloat.Apfloat p)Is the value OK? (i.e.static voidmain(java.lang.String[] args)static longmaxRankSum(int n, int nt)Maximum possible rank sumstatic doublemean(int n, int nt)Mean value for a given N and N_Tstatic longminRankSum(int n, int nt)Minimum possible rank sumstatic org.apfloat.Apfloatpdf(int n, int nt, int r)Probability density function (pdf)static org.apfloat.ApfloatpdfNormal(int n, int nt, int r)Normal approximation to rank sum statisticstatic doublesigma(int n, int nt)Wrapper to Sqrt(variance)static doublevariance(int n, int nt)Variance for a given N and N_T
-
-
-
Field Detail
-
CACHE_MAX_N
public static final int CACHE_MAX_N
Cache size roughly (N * NT)^2- See Also:
- Constant Field Values
-
CACHE_MAX_NT
public static final int CACHE_MAX_NT
- See Also:
- Constant Field Values
-
BAD
public static final org.apfloat.Apfloat BAD
-
SMALL
public static double SMALL
A small number
-
-
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 numbernt- : Number of elements in the sumr- : 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 numbernt- : Number of elements in the sumr- : 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 numbernt- : Number of elements in the sumr- : 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 numbernt- : Number of elements in the sumr- : 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:
-
-