scipy.special.chdtri#
- scipy.special.chdtri(v, p, out=None) = <ufunc 'chdtri'>#
Inverse to
chdtrcwith respect to x.Returns x such that
chdtrc(v, x) == p.- Parameters:
- varray_like
Degrees of freedom.
- parray_like
Probability.
- outndarray, optional
Optional output array for the function results.
- Returns:
- xscalar or ndarray
Value so that the probability a Chi square random variable with v degrees of freedom is greater than x equals p.
Notes
Array API Standard Support
chdtrihas 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 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.chdtridoes not currently supportoutfor the PyTorch backend.See Support for the array API standard for more information.
References
[1]Chi-Square distribution, https://www.itl.nist.gov/div898/handbook/eda/section3/eda3666.htm
Examples
>>> import scipy.special as sc
It inverts
chdtrc.>>> v, p = 1, 0.3 >>> sc.chdtrc(v, sc.chdtri(v, p)) 0.3 >>> x = 1 >>> sc.chdtri(v, sc.chdtrc(v, x)) 1.0