scipy.special.chdtriv#

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

Inverse to chdtr with respect to v.

Returns v such that chdtr(v, x) == p.

Parameters
parray_like

Probability that the Chi square random variable is less than or equal to x.

xarray_like

Nonnegative input.

outndarray, optional

Optional output array for the function results.

Returns
scalar or ndarray

Degrees of freedom.

See also

chdtr, chdtrc, chdtri

References

1

Chi-Square distribution, https://www.itl.nist.gov/div898/handbook/eda/section3/eda3666.htm

Examples

>>> import scipy.special as sc

It inverts chdtr.

>>> p, x = 0.5, 1
>>> sc.chdtr(sc.chdtriv(p, x), x)
0.5000000000202172
>>> v = 1
>>> sc.chdtriv(sc.chdtr(v, x), v)
1.0000000000000013