Class KolmogorovSmirnovDistribution
java.lang.Object
org.apache.commons.statistics.inference.KolmogorovSmirnovDistribution
Computes the complementary probability for the one-sample Kolmogorov-Smirnov distribution.
- Since:
- 1.1
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static final class
Computes the complementary probabilityP[D_n^+ >= x]
for the one-sided one-sample Kolmogorov-Smirnov distribution.(package private) static final class
Computes the complementary probabilityP[D_n >= x]
, or survival function (SF), for the two-sided one-sample Kolmogorov-Smirnov distribution. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final double
Machine epsilon, 2^-52.private static final double
pi^2.private static final double
sqrt(2*pi).private static final double
Value of x when the KS sum is 0.5.private static final double
Value of x when the KS sum is 1.0. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) static double
clipProbability
(double p) Clip the probability to the range [0, 1].(package private) static double
ksSum
(double x) ComputesP(sqrt(n) D_n > x)
, the limiting form for the distribution of Kolmogorov's D_n as described in Simard and L’Ecuyer (2011) (Eq.
-
Field Details
-
PI2
private static final double PI2pi^2.- See Also:
-
ROOT_TWO_PI
private static final double ROOT_TWO_PIsqrt(2*pi).- See Also:
-
X_KS_HALF
private static final double X_KS_HALFValue of x when the KS sum is 0.5.- See Also:
-
X_KS_ONE
private static final double X_KS_ONEValue of x when the KS sum is 1.0.- See Also:
-
EPS
private static final double EPSMachine epsilon, 2^-52.- See Also:
-
-
Constructor Details
-
KolmogorovSmirnovDistribution
private KolmogorovSmirnovDistribution()No instances.
-
-
Method Details
-
ksSum
static double ksSum(double x) ComputesP(sqrt(n) D_n > x)
, the limiting form for the distribution of Kolmogorov's D_n as described in Simard and L’Ecuyer (2011) (Eq. 5, or K0 Eq. 6).Computes \( 2 \sum_{i=1}^\infty (-1)^(i-1) e^{-2 i^2 x^2} \), or \( 1 - (\sqrt{2 \pi} / x) * \sum_{i=1}^\infty { e^{-(2i-1)^2 \pi^2 / (8x^2) } } \) when x is small.
Note: This computes the upper Kolmogorov sum.
- Parameters:
x
- Argument x = sqrt(n) * d- Returns:
- Upper Kolmogorov sum evaluated at x
-
clipProbability
static double clipProbability(double p) Clip the probability to the range [0, 1].- Parameters:
p
- Probability.- Returns:
- p in [0, 1]
-