scipy.special.ncfdtri#
- scipy.special.ncfdtri(dfn, dfd, nc, p, out=None) = <wrapped_ufunc 'ncfdtri'>#
Inverse with respect to f of the CDF of the non-central F distribution.
See
ncfdtrfor more details.- Parameters:
- dfnarray_like
Degrees of freedom of the numerator sum of squares. Range (0, inf).
- dfdarray_like
Degrees of freedom of the denominator sum of squares. Range (0, inf).
- ncarray_like
Noncentrality parameter. Range [0, inf).
- parray_like
Value of the cumulative distribution function. Must be in the range [0, 1].
- outndarray, optional
Optional output array for the function results
- Returns:
- fscalar or ndarray
Quantiles, i.e., the upper limit of integration.
See also
ncfdtrCDF of the non-central F distribution.
ncfdtridfdInverse of
ncfdtrwith respect to dfd.ncfdtridfnInverse of
ncfdtrwith respect to dfn.ncfdtrincInverse of
ncfdtrwith respect to nc.scipy.stats.ncfNon-central F distribution.
Notes
This function calculates the Quantile of the non-central f distribution using the Boost Math C++ library [1].
Note that argument order of
ncfdtriis different from that of the similarppfmethod ofscipy.stats.ncf. p is the last parameter ofncfdtribut the first parameter ofscipy.stats.ncf.ppf.Array API Standard Support
ncfdtrihas 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.ncfdtridoes not currently supportoutfor the PyTorch backend.See Array API coverage for more information.
References
[1]The Boost Developers. “Boost C++ Libraries”. https://www.boost.org/.
Examples
>>> from scipy.special import ncfdtr, ncfdtri
Compute the CDF for several values of f:
>>> f = [0.5, 1, 1.5] >>> p = ncfdtr(2, 3, 1.5, f) >>> p array([ 0.20782291, 0.36107392, 0.47345752])
Compute the inverse. We recover the values of f, as expected:
>>> ncfdtri(2, 3, 1.5, p) array([ 0.5, 1. , 1.5])