Class KolmogorovSmirnovDistribution
- java.lang.Object
-
- org.apache.commons.statistics.inference.KolmogorovSmirnovDistribution
-
final class KolmogorovSmirnovDistribution extends java.lang.Object
Computes the complementary probability for the one-sample Kolmogorov-Smirnov distribution.- Since:
- 1.1
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static class
KolmogorovSmirnovDistribution.One
Computes the complementary probabilityP[D_n^+ >= x]
for the one-sided one-sample Kolmogorov-Smirnov distribution.(package private) static class
KolmogorovSmirnovDistribution.Two
Computes the complementary probabilityP[D_n >= x]
, or survival function (SF), for the two-sided one-sample Kolmogorov-Smirnov distribution.
-
Field Summary
Fields Modifier and Type Field Description private static double
EPS
Machine epsilon, 2^-52.private static double
PI2
pi^2.private static double
ROOT_TWO_PI
sqrt(2*pi).private static double
X_KS_HALF
Value of x when the KS sum is 0.5.private static double
X_KS_ONE
Value of x when the KS sum is 1.0.
-
Constructor Summary
Constructors Modifier Constructor Description private
KolmogorovSmirnovDistribution()
No instances.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description (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 Detail
-
PI2
private static final double PI2
pi^2.- See Also:
- Constant Field Values
-
ROOT_TWO_PI
private static final double ROOT_TWO_PI
sqrt(2*pi).- See Also:
- Constant Field Values
-
X_KS_HALF
private static final double X_KS_HALF
Value of x when the KS sum is 0.5.- See Also:
- Constant Field Values
-
X_KS_ONE
private static final double X_KS_ONE
Value of x when the KS sum is 1.0.- See Also:
- Constant Field Values
-
EPS
private static final double EPS
Machine epsilon, 2^-52.- See Also:
- Constant Field Values
-
-
Method Detail
-
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]
-
-