scipy.special.chndtrinc#

scipy.special.chndtrinc(x, df, p, out=None) = <ufunc 'chndtrinc'>#

Inverse of chndtr with respect to nc.

Finds the non-centrality parameter nc such that

\[\operatorname{chndtr}(x, df, nc) = p.\]
Parameters:
xarray_like

Upper bound of the integral; must satisfy x >= 0.

dfarray_like

Degrees of freedom; must satisfy df > 0.

parray_like

Probability; must satisfy 0 <= p < 1.

outndarray, optional

Optional output array for the function results.

Returns:
ncscalar or ndarray

Non-centrality parameter.

See also

chndtr

Noncentral chi-squared distribution CDF

chndtridf

Inverse of chndtr with respect to df

chndtrinc

Inverse of chndtr with respect to nc

scipy.stats.ncx2

Non-central chi-squared distribution

Notes

The noncentral chi squared distribution is also available in scipy.stats.ncx2.

This function wraps routines from the Boost Math C++ library [1].

References

[1]

The Boost Developers. “Boost C++ Libraries”. https://www.boost.org/.

Examples

>>> from scipy.special import chndtrinc, chndtr

Compute the noncentral chi squared distribution CDF at one point.

>>> x, df, nc = 3, 5, 10
>>> p = chndtr(x, df, nc)

chndtrinc is the inverse of chndtr with respect to nc:

>>> chndtrinc(x, df, p)
10.0