scipy.special.smirnovi#
- scipy.special.smirnovi(n, p, out=None) = <wrapped_ufunc 'smirnovi'>#
Inverse to
smirnov.Returns d such that
smirnov(n, d) == p, the critical value corresponding to p.- Parameters:
- nint
Number of samples
- pfloat array_like
Probability
- outndarray, optional
Optional output array for the function results
- Returns:
- scalar or ndarray
The value(s) of smirnovi(n, p), the critical values.
See also
smirnovThe Survival Function (SF) for the distribution
scipy.stats.ksoneProvides the functionality as a continuous distribution
kolmogorov,kolmogiFunctions for the two-sided distribution
scipy.stats.kstwobignTwo-sided Kolmogorov-Smirnov distribution, large n
Notes
For historical reasons this function is exposed in
scipy.special, but the recommended way to achieve the most accurate CDF/SF/PDF/PPF/ISF computations is to use thescipy.stats.ksonedistribution.Array API Standard Support
smirnovihas support for Python Array API Standard compatible backends in addition to NumPy. The following combinations of backend and device (or other capability) are supported.Library
CPU
GPU
NumPy
✅
n/a
CuPy
n/a
⛔
PyTorch
✅
⛔
JAX
✅
⛔
Dask
✅
n/a
For the NumPy backend, this function supports all NumPy ufunc keyword arguments. Other backends may support
out, but typically none of the other ufunc kwargs.outis typically supported for CuPy and PyTorch, but not currently in cases where SciPy relies on a generic Array API implementation or, for PyTorch on CPU, falls back to the NumPy backend.outis never supported for JAX because JAX arrays are immutable.smirnovidoes not currently supportoutfor the PyTorch backend.See Support for the array API standard for more information.
Examples
>>> from scipy.special import smirnovi, smirnov
>>> n = 24 >>> deviations = [0.1, 0.2, 0.3]
Use
smirnovto compute the complementary CDF of the Smirnov distribution for the given number of samples and deviations.>>> p = smirnov(n, deviations) >>> p array([0.58105083, 0.12826832, 0.01032231])
The inverse function
smirnovi(n, p)returnsdeviations.>>> smirnovi(n, p) array([0.1, 0.2, 0.3])