scipy.special.stdtridf#
- scipy.special.stdtridf(p, t, out=None) = <wrapped_ufunc 'stdtridf'>#
Inverse of
stdtrvs df.Returns the argument df such that stdtr(df, t) is equal to p.
- Parameters:
- parray_like
Probability
- tarray_like
Upper bound of the integral
- outndarray, optional
Optional output array for the function results
- Returns:
- dfscalar or ndarray
Value of df such that
stdtr(df, t) == p
See also
stdtrStudent t CDF
stdtritinverse of stdtr with respect to t
scipy.stats.tStudent t distribution
Notes
Array API Standard Support
stdtridfhas 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.stdtridfdoes not currently supportoutfor the PyTorch backend.See Array API coverage for more information.
Examples
Compute the student t cumulative distribution function for one parameter set.
>>> from scipy.special import stdtr, stdtridf >>> df, x = 5, 2 >>> cdf_value = stdtr(df, x) >>> cdf_value 0.9490302605850709
Verify that
stdtridfrecovers the original value for df given the CDF value and x.>>> stdtridf(cdf_value, x) 5.000000000000012