scipy.special.nctdtrinc#

scipy.special.nctdtrinc(df, p, t, out=None) = <wrapped_ufunc 'nctdtrinc'>#

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

See nctdtr for more details.

Parameters:
dfarray_like

Degrees of freedom of the distribution. Should be in range (0, inf).

parray_like

CDF values, in range (0, 1].

tarray_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

nctdtr

CDF of the non-central t distribution.

nctdtrit

Inverse CDF (iCDF) of the non-central t distribution.

nctdtridf

Calculate degrees of freedom, given CDF and iCDF values.

Notes

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

Array API Standard Support

nctdtrinc 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. nctdtrinc 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 nctdtr, nctdtrinc

Compute the CDF for several values of nc:

>>> nc = [0.5, 1.5, 2.5]
>>> p = nctdtr(3, nc, 1.5)
>>> p
array([0.77569497, 0.45524533, 0.1668691 ])

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

>>> nctdtrinc(3, p, 1.5)
array([0.5, 1.5, 2.5])