scipy.special.fdtridfd#

scipy.special.fdtridfd(dfn, p, x, out=None) = <wrapped_ufunc 'fdtridfd'>#

Inverse to fdtr vs dfd.

Finds the F density argument dfd such that fdtr(dfn, dfd, x) == p.

Parameters:
dfnarray_like

First parameter (positive float).

parray_like

Cumulative probability, in [0, 1].

xarray_like

Argument (nonnegative float).

outndarray, optional

Optional output array for the function values

Returns:
dfdscalar or ndarray

dfd such that fdtr(dfn, dfd, x) == p.

See also

fdtr

F distribution cumulative distribution function

fdtrc

F distribution survival function

fdtri

F distribution quantile function

scipy.stats.f

F distribution

Notes

Array API Standard Support

fdtridfd 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. fdtridfd does not currently support out for the PyTorch backend.

See Array API coverage for more information.

Examples

Compute the F distribution cumulative distribution function for one parameter set.

>>> from scipy.special import fdtridfd, fdtr
>>> dfn, dfd, x = 10, 5, 2
>>> cdf_value = fdtr(dfn, dfd, x)
>>> cdf_value
0.7700248806501017

Verify that fdtridfd recovers the original value for dfd:

>>> fdtridfd(dfn, cdf_value, x)
5.0