scipy.special.ncfdtrinc#

scipy.special.ncfdtrinc(dfn, dfd, p, f, out=None) = <wrapped_ufunc 'ncfdtrinc'>#

Calculate non-centrality parameter for non-central F distribution.

This is the inverse with respect to nc of ncfdtr. See ncfdtr for 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).

parray_like

Value of the cumulative distribution function. Must be in the range [0, 1].

farray_like

Quantiles, i.e., the upper limit of integration.

outndarray, optional

Optional output array for the function results

Returns:
ncscalar or ndarray

Noncentrality parameter.

See also

ncfdtr

CDF of the non-central F distribution.

ncfdtri

Quantile function; inverse of ncfdtr with respect to f.

ncfdtridfd

Inverse of ncfdtr with respect to dfd.

ncfdtridfn

Inverse of ncfdtr with respect to dfn.

Notes

This function calculates the non-centrality parameter of the non-central F distribution given a probability, quantile, and degrees of freedom using the Boost Math C++ library [1].

Array API Standard Support

ncfdtrinc has 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. out is 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. out is never supported for JAX because JAX arrays are immutable. ncfdtrinc does not currently support out for 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 ncfdtr, ncfdtrinc

Compute the CDF for several values of nc:

>>> nc = [0.5, 1.5, 2.0]
>>> p = ncfdtr(2, 3, nc, 15)
>>> p
array([ 0.96309246,  0.94327955,  0.93304098])

Compute the inverse. We recover the values of nc, as expected:

>>> ncfdtrinc(2, 3, p, 15)
array([ 0.5,  1.5,  2. ])