# Computing the Cumulative Distribution Function and Quantiles of the   limit of the Two-sided Kolmogorov-Smirnov Statistic

**Authors:** Paul van Mulbregt

arXiv: 1803.00426 · 2018-03-02

## TL;DR

This paper addresses the computational challenges of the Kolmogorov-Smirnov distribution functions, proposing new algorithms that improve accuracy and efficiency for calculating the CDF and quantiles, especially for large samples.

## Contribution

The authors develop alternative algorithms that enhance the computation of the KS distribution's CDF and quantiles, correcting inaccuracies and convergence issues in existing approximations.

## Key findings

- Existing approximations in SciPy increase computation time and cause convergence failures.
- New algorithms restore accuracy and efficiency across the entire domain.
- Improved methods facilitate more reliable goodness-of-fit testing using KS statistics.

## Abstract

The cumulative distribution and quantile functions for the two-sided one sample Kolmogorov-Smirnov probability distributions are used for goodness-of-fit testing. The CDF is notoriously difficult to explicitly describe and to compute, and for large sample size use of the limiting distribution is an attractive alternative, with its lower computational requirements. No closed form solution for the computation of the quantiles is known. Computing the quantile function by a numeric root-finder for any specific probability may require multiple evaluations of both the CDF and its derivative. Approximations to both the CDF and its derivative can be used to reduce the computational demands. We show that the approximations in use inside the open source SciPy python software result in increased computation, not just reduced accuracy, and cause convergence failures in the root-finding. Then we provide alternate algorithms which restore accuracy and efficiency across the whole domain.

## Full text

_Full body text omitted from this summary view._ Fetch the complete paper as Markdown: https://tomesphere.com/paper/1803.00426/full.md

## Figures

3 figures with captions in the complete paper: https://tomesphere.com/paper/1803.00426/full.md

## References

25 references — full list in the complete paper: https://tomesphere.com/paper/1803.00426/full.md

---
Source: https://tomesphere.com/paper/1803.00426