mapie.metrics.kolmogorov_smirnov_cdf

mapie.metrics.kolmogorov_smirnov_cdf(x: float) float[source]

Compute the Kolmogorov-smirnov cumulative distribution function (CDF) for the float x. This is interpreted as the CDF of the maximum absolute value of the standard Brownian motion over the unit interval [0, 1]. The function is approximated by its power series, truncated so as to hit machine precision error.

Parameters
xfloat

The float x to compute the cumulative distribution function on.

Returns
float

The Kolmogorov-smirnov cumulative distribution function.

References

Tygert M. Calibration of P-values for calibration and for deviation of a subpopulation from the full population. arXiv preprint arXiv:2202.00100. 2022 Jan 31.

D. A. Darling. A. J. F. Siegert. The First Passage Problem for a Continuous Markov Process. Ann. Math. Statist. 24 (4) 624 - 639, December, 1953.

Examples

>>> import numpy as np
>>> from mapie.metrics import kolmogorov_smirnov_cdf
>>> print(np.round(kolmogorov_smirnov_cdf(1), 4))
0.3708