scipy.special.nctdtrit#
- scipy.special.nctdtrit(df, nc, p, out=None) = <wrapped_ufunc 'nctdtrit'>#
Inverse cumulative distribution function of the non-central t distribution.
See
nctdtrfor more details.- Parameters:
- dfarray_like
Degrees of freedom of the distribution. Should be in range (0, inf).
- ncarray_like
Noncentrality parameter.
- parray_like
CDF values, in range (0, 1].
- outndarray, optional
Optional output array for the function results
- Returns:
- tscalar or ndarray
Quantiles
See also
Notes
This function calculates the quantile of the non-central t distribution using the Boost Math C++ library [1].
Note that the argument order of
nctdtritis different from that of the similarppfmethod ofscipy.stats.nct: t is the last parameter ofnctdtritbut the first parameter ofscipy.stats.nct.ppf.Array API Standard Support
nctdtrithas 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.nctdtritdoes not currently supportoutfor the PyTorch backend.See Support for the array API standard for more information.
References
[1]The Boost Developers. “Boost C++ Libraries”. https://www.boost.org/.
Examples
>>> from scipy.special import nctdtr, nctdtrit
Compute the CDF for several values of t:
>>> t = [0.5, 1, 1.5] >>> p = nctdtr(3, 1, t) >>> p array([0.29811049, 0.46922687, 0.6257559 ])
Compute the inverse. We recover the values of t, as expected:
>>> nctdtrit(3, 1, p) array([0.5, 1. , 1.5])