|
KolmogorovSmirnovDistributionCumulativeFunction Method
|
Computes the Cumulative Distribution Function (CDF)
for the Kolmogorov-Smirnov statistic's distribution.
Namespace:
Accord.Statistics.Distributions.Univariate
Assembly:
Accord.Statistics (in Accord.Statistics.dll) Version: 3.8.0
Syntax public static double CumulativeFunction(
double n,
double x
)
Public Shared Function CumulativeFunction (
n As Double,
x As Double
) As Double
Request Example
View SourceParameters
- n
- Type: SystemDouble
The sample size. - x
- Type: SystemDouble
The Kolmogorov-Smirnov statistic.
Return Value
Type:
DoubleReturns the cumulative probability of the statistic
x under a sample size
n.
Remarks
This function computes the cumulative probability P[Dn <= x] of
the Kolmogorov-Smirnov distribution using multiple methods as
suggested by Richard Simard (2010).
Simard partitioned the problem of evaluating the CDF using multiple
approximation and asymptotic methods in order to achieve a best compromise
between speed and precision. This function follows the same partitioning as
Simard, which is described in the table below.
For n <= 140 and: |
---|
1/n > x >= 1-1/n | Uses the Ruben-Gambino formula. |
1/n < nx² < 0.754693 | Uses the Durbin matrix algorithm. |
0.754693 <= nx² < 4 | Uses the Pomeranz algorithm. |
4 <= nx² < 18 | Uses the complementary distribution function. |
nx² >= 18 | Returns the constant 1. |
For 140 < n <= 10^5 |
---|
nx² >= 18 | Returns the constant 1. |
nx^(3/2) < 1.4 | Durbin matrix algorithm. |
nx^(3/2) > 1.4 | Pelz-Good asymptotic series. |
For n > 10^5 |
---|
nx² >= 18 | Returns the constant 1. |
nx² < 18 | Pelz-Good asymptotic series. |
See Also