﻿ KolmogorovSmirnovDistribution.CumulativeFunction 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
)

#### Parameters

n
Type: SystemDouble
The sample size.
x
Type: SystemDouble
The Kolmogorov-Smirnov statistic.

#### Return Value

Type: Double
Returns 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/nUses the Ruben-Gambino formula.
1/n < nx² < 0.754693Uses the Durbin matrix algorithm.
0.754693 <= nx² < 4Uses the Pomeranz algorithm.
4 <= nx² < 18Uses the complementary distribution function.
nx² >= 18Returns the constant 1.
For 140 < n <= 10^5
nx² >= 18Returns the constant 1.
nx^(3/2) < 1.4Durbin matrix algorithm.
nx^(3/2) > 1.4Pelz-Good asymptotic series.
For n > 10^5
nx² >= 18Returns the constant 1.
nx² < 18Pelz-Good asymptotic series.