public class KolmogorovTwoSample extends Object implements Serializable
Class KolmogorovTwoSample
computes KolmogorovSmirnov twosample
test statistics for testing that two continuous cumulative distribution functions (CDF's)
are identical based upon two random samples. One or twosided alternatives are
allowed. Exact pvalues are computed for the twosided test when
,
where n is the number of nonmissing X observations and
m the number of nonmissing Y observation.
Let denote the empirical CDF in the X sample,
let denote the empirical CDF in the Y sample
and let the corresponding population
distribution functions be denoted by
and , respectively.
Then, the hypotheses tested by KolmogorovTwoSample
are as follows:
Exact probabilities for the twosided test are computed when , according to an algorithm given by Kim and Jennrich (1973). When , the very good approximations given by Kim and Jennrich are used to obtain the twosided pvalues. The onesided probability is taken as one half the twosided probability. This is a very good approximation when the pvalue is small (say, less than 0.10) and not very good for large pvalues.
Constructor and Description 

KolmogorovTwoSample(double[] x,
double[] y)
Constructs a two sample KolmogorovSmirnov goodnessoffit test.

Modifier and Type  Method and Description 

double 
getMaximumDifference()
Returns ,
the maximum difference between the theoretical and empirical CDF's.

double 
getMinimumDifference()
Returns ,
the minimum difference between the theoretical and empirical CDF's.

int 
getNumberMissingX()
Returns the number of missing values in the
x sample. 
int 
getNumberMissingY()
Returns the number of missing values in the
y sample. 
double 
getOneSidedPValue()
Probability of the statistic exceeding D under
the null hypothesis of equality and against the
onesided alternative.

double 
getTestStatistic()
Returns .

double 
getTwoSidedPValue()
Probability of the statistic exceeding D under
the null hypothesis of equality and against the
twosided alternative.

double 
getZ()
Returns the normalized D statistic without the continuity correction applied.

public KolmogorovTwoSample(double[] x, double[] y)
x
 is an array containing the observations from the first sample.y
 is an array containing the observations from the second sample.public double getMaximumDifference()
public double getMinimumDifference()
public int getNumberMissingX()
x
sample.x
.public int getNumberMissingY()
y
sample.y
.public double getOneSidedPValue()
public double getTestStatistic()
public double getTwoSidedPValue()
getOneSidedPValue
,
(or 1.0 if .
This approximation is nearly exact when
.public double getZ()
Copyright © 19702015 Rogue Wave Software
Built October 13 2015.