|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--MathMAE
This class contains math functions used for computing statistics in MAExplorer. Some of these methods were derived from WebGel, GELLAB-II, and Numerical Recipes in C.
This work was produced by Peter Lemkin of the National Cancer Institute, an agency of the United States Government. As a work of the United States Government there is no associated copyright. It is offered as open source software under the Mozilla Public License (version 1.1) subject to the limitations noted in the accompanying LEGAL file. This notice must be included with the code. The MAExplorer Mozilla and Legal files are available on http://maexplorer.sourceforge.net/.
Field Summary | |
static double |
dKS
RTN: K-S statistic |
(package private) static double[] |
gammln_cof
|
static double |
ln10
log(10 base e |
static double |
ln2
log(2) base e |
static double |
log10e
log(e) base 10 |
static double |
log2e
log(e) base 2 |
static double |
mnX
RTN: mean X |
static double |
mnY
RTN: mean Y |
static int |
nXY
RTN: if calcXYstat |
static boolean |
okBetaCF
RTN: if nr_betacf() was ok |
static boolean |
okBetaI
RTN: if nr_betai() was ok |
static boolean |
okProbKS
RTN: if nr_probks() was ok |
static double |
probKS
RTN: probability of null hypoth same distrib |
static double |
rSq
RTN: correlation coefficient |
static double |
sdX
RTN: standard deviation X |
static double |
sdY
RTN: standard deviation Y |
Constructor Summary | |
MathMAE()
|
Method Summary | |
static double |
alog10(double x)
alog10() - compute alog(x) base 10. |
static double |
alog2(double x)
alog2() - compute alog(x) base 2. |
static float |
calcPearsonCorrCoef(float[] data1,
float[] data2,
int n,
boolean usePopulationCovar)
calcPearsonCorrCoef() - compute Pearson correlation coefficient The data is data1[0:n-1] and data2[0:n-1]. |
static java.lang.String |
calcXYstat(int n,
float[] xList,
float[] yList,
int[] propList,
java.lang.String xLbl,
java.lang.String yLbl)
calcXYstat() - compute correlation statistics string for display rSq=.., n=.., X(mn+-sd)=(..+-..), Y(mn+-sd)=(..+-..) If propList[] is not null, then test if filtered using fc.IS_FILTERED value. |
static float |
cityBlockDist(float[] data1,
float[] data2,
int n,
boolean rtnAbsSumFlag)
cityBlockDist() - compute city-block distance of 2 vectors. |
static float |
euclidDist(float[] data1,
float[] data2,
int n,
boolean rtnDistSqFlag)
euclidDist() - compute Euclidean distance or (sum dist**2) The data is data1[0:n-1] and data2[0:n-1]. |
static double |
log10(double x)
log10() - compute log(x) base 10. |
static double |
log2(double x)
log2() - compute log(x) base 2. |
static double |
log2Zero(double x)
log2Zero() - compute log2((x==0.0 ? 0.0 : x) - avoid log2(0.0)! This defaults log2(0.0) to log2(1.0). |
static double |
logZero(double x)
logZero() - compute log10((x==0.0 ? 0.0 : x) - avoid log(0.0)! This defaults log10(0.0) to log(1.0). |
static double |
nr_betacf(double a,
double b,
double x)
nr_betacf() - evaluation fct for the incomplete Beta function 'x(a,b). |
static double |
nr_betai(double a,
double b,
double x)
nr_betai() - return the incomplete Beta function 'x(a,b). |
static double |
nr_gammln(double xx)
nr_gammln() - Return ln(gamma()) of x by polynomial evaluation. |
static boolean |
nr_kstwo(double[] data1,
int n1,
double[] data2,
int n2)
nr_kstwo() - Kolmogorov-Smirnov statistic d and the probability of the null hypothesis of 2 bins of data. |
static double |
nr_probks(double alam)
nr_probks() - Calc Kolmogorov-Smirnov probability qKS. |
static boolean |
nr_sort(int n,
double[] data)
nr_sort() - quick-sort of bin of data[0:n-1] in assend. |
Methods inherited from class java.lang.Object |
|
Field Detail |
static final double[] gammln_cof
public static final double ln10
public static final double log10e
public static final double ln2
public static final double log2e
public static boolean okBetaCF
public static boolean okBetaI
public static boolean okProbKS
public static double dKS
public static double probKS
public static int nXY
public static double rSq
public static double mnX
public static double mnY
public static double sdX
public static double sdY
Constructor Detail |
public MathMAE()
Method Detail |
public static double nr_gammln(double xx)
xx
- argpublic static double nr_betacf(double a, double b, double x)
a
- argb
- argx
- argpublic static double nr_betai(double a, double b, double x)
a
- - a parameter of 'x(a,b)b
- - b parameter of 'x(a,b)x
- - x parameter of 'x(a,b)nr_betacf(double, double, double)
,
nr_gammln(double)
public static boolean nr_sort(int n, double[] data)
n
- is the amount of data.data
- is the set of data [0:n-1].public static boolean nr_kstwo(double[] data1, int n1, double[] data2, int n2)
data1
- [0:n1-1] data1n2
- # of items in data 1data1
- [0:n2-1] data2n2
- # of items in data 2RTN: dKS - K-S statistic, and RTN: probKS - probl of null hypoth same distribution
nr_probks(double)
,
nr_sort(int, double[])
public static double nr_probks(double alam)
alam
- the value computed in kstwo().public static java.lang.String calcXYstat(int n, float[] xList, float[] yList, int[] propList, java.lang.String xLbl, java.lang.String yLbl)
n
- size of listsxList
- is X class datayList
- is Y class datapropList
- is properties dataxLbl
- is label for the X datayLbl
- is label for the Y dataUtil.cvd2s(double, int)
,
Util.cvf2s(float, int)
public static float euclidDist(float[] data1, float[] data2, int n, boolean rtnDistSqFlag)
data1
- is vector [0:n-1] of object 1data2
- is vector [0:n-1] of object 2n
- is size of vectorrtnDistSqFlag
- return(sum dist**2) else Euclidean distance.public static float cityBlockDist(float[] data1, float[] data2, int n, boolean rtnAbsSumFlag)
data1
- is vector [0:n-1] of object 1data2
- is vector [0:n-1] of object 2n
- is size of vectorrtnAbsSumFlag
- return (sum absDiffs) else mean city block distance.public static float calcPearsonCorrCoef(float[] data1, float[] data2, int n, boolean usePopulationCovar)
data1
- is vector [0:n-1] of object 1data2
- is vector [0:n-1] of object 2n
- is size of vectorusePopulationCovar
- flag to compute population covariance
(Weinstein) U. Scherf, Nat.Genetics (2000) 24:236-244, pg 243.
else version for large samples in Snedecore & Cochran 1st
Edition page 175.public static double log2Zero(double x)
x
- argument for log2log2(double)
public static double log2(double x)
x
- argument for log2public static double alog2(double x)
x
- argument for alogpublic static double logZero(double x)
x
- argument for loglog10(double)
public static double log10(double x)
x
- argument for logpublic static double alog10(double x)
x
- argument for alog
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |