# SuanShu, a Java numerical and statistical library

com.numericalmethod.suanshu.stats.test.distribution.kolmogorov

## Class KolmogorovTwoSamplesDistribution

• java.lang.Object
• com.numericalmethod.suanshu.stats.test.distribution.kolmogorov.KolmogorovTwoSamplesDistribution
• All Implemented Interfaces:
ProbabilityDistribution

public class KolmogorovTwoSamplesDistribution
extends Object
implements ProbabilityDistribution
Compute the p-values for the generalized (conditionally distribution-free) Smirnov homogeneity test. That is, $P(D_{m,n} \geq c | H_0) = 1 - P(D_{m,n} c | H_0) = 1 - \textup{cdf}(c)$ where $D_{m,n} = \max \left | S_m(x) - S_n(x) \right |$
• "Andrei M. Nikiforov, "Algorithm AS 288: Exact Smirnov Two-Sample Tests for Arbitrary Distributions," Royal Statistical Society, 1994."
• "Jean Dickinson Gibbons, Subhabrata Chakraborti, "Section 6.3," Nonparametric Statistical Inference, 4th edition, CRC."
• ### Constructor Detail

• #### KolmogorovTwoSamplesDistribution

public KolmogorovTwoSamplesDistribution(int n1,
int n2,
double[] samples,
KolmogorovTwoSamplesDistribution.Side side,
int bigN)
Construct a two-sample Kolmogorov distribution.
Parameters:
n1 - the size of sample 1
n2 - the size of sample 2
samples - the concatenation of the two samples in ascending order
side - one-sided or two-sided test
bigN - the threshold to use the asymptotic distribution when n > bigN
• #### KolmogorovTwoSamplesDistribution

public KolmogorovTwoSamplesDistribution(int n1,
int n2,
KolmogorovTwoSamplesDistribution.Side side,
int bigN)
Construct a two-sample Kolmogorov distribution, assuming that there is no tie in the samples.
Parameters:
n1 - the size of sample 1
n2 - the size of sample 2
side - one-sided or two-sided test
bigN - the threshold to use the asymptotic distribution when n > bigN
• #### KolmogorovTwoSamplesDistribution

public KolmogorovTwoSamplesDistribution(int n1,
int n2,
KolmogorovTwoSamplesDistribution.Side side,
double[] samples)
Construct a two-sample Kolmogorov distribution.
Parameters:
n1 - the size of sample 1
n2 - the size of sample 2
side - one-sided or two-sided test
samples - the concatenation of the two samples in ascending order
• #### KolmogorovTwoSamplesDistribution

public KolmogorovTwoSamplesDistribution(double[] sample1,
double[] sample2,
KolmogorovTwoSamplesDistribution.Side side)
Construct a two-sample Kolmogorov distribution.
Parameters:
sample1 - sample 1
sample2 - sample 2
side - one-sided or two-sided test