public class KolmogorovSmirnov extends HypothesisTest
The Kolmogorov–Smirnov statistic quantifies a distance between the empirical distribution function of the sample and the cumulative distribution function of the reference distribution (one-sample KS test), or between the empirical distribution functions of two samples (two-sample KS test).
The null distribution of this statistic is calculated under the null hypothesis that the sample is drawn from the reference distribution (in the one-sample case), or that the samples are drawn from the same distribution (in the two-sample case)
In each case, the distributions considered under the null hypothesis are continuous distributions but are otherwise unrestricted.
The test-statistics is either Dn, Dn+, or Dn-, depending on the side to compute
By R convention, when exact p-values are not available, we use limiting distribution. Exact p-values are not available in the case of ties for one-sample case.
The R equivalent function is ks.test.
| Modifier and Type | Class and Description |
|---|---|
static class |
KolmogorovSmirnov.Side
the type of Kolmogorov-Smirnov statistic available
|
static class |
KolmogorovSmirnov.Type
the types of Kolmogorov-Smirnov tests available
|
| Modifier and Type | Field and Description |
|---|---|
KolmogorovSmirnov.Side |
side
the type of Kolmogorov-Smirnov statistic to be computed
|
KolmogorovSmirnov.Type |
type
the type of Kolmogorov-Smirnov test to be performed
|
k, N, pValue, testStatistics| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getAlternativeHypothesis()
Get a description of the alternative hypothesis.
|
java.lang.String |
getNullHypothesis()
Get a description of the null hypothesis.
|
isNullRejected, oneSidedPvalue, pValue, statisticspublic final KolmogorovSmirnov.Type type
public final KolmogorovSmirnov.Side side
public java.lang.String getNullHypothesis()
HypothesisTestgetNullHypothesis in class HypothesisTestpublic java.lang.String getAlternativeHypothesis()
HypothesisTestgetAlternativeHypothesis in class HypothesisTest