# naginterfaces.library.stat.inv_​cdf_​chisq¶

naginterfaces.library.stat.inv_cdf_chisq(p, df)[source]

inv_cdf_chisq returns the deviate associated with the given lower tail probability of the -distribution with real degrees of freedom.

For full information please refer to the NAG Library document for g01fc

https://www.nag.com/numeric/nl/nagdoc_28.4/flhtml/g01/g01fcf.html

Parameters
pfloat

, the lower tail probability from the required -distribution.

dffloat

, the degrees of freedom of the -distribution.

Returns
xfloat

The deviate associated with the given lower tail probability of the -distribution with real degrees of freedom.

Raises
NagValueError
(errno )

On entry, .

Constraint: .

(errno )

On entry, .

Constraint: .

(errno )

On entry, .

Constraint: .

(errno )

The probability is too close to or .

(errno )

The series used to calculate the gamma function has failed to converge. This is an unlikely error exit.

Warns
NagAlgorithmicWarning
(errno )

The algorithm has failed to converge in iterations. The result should be a reasonable approximation.

Notes

The deviate, , associated with the lower tail probability of the -distribution with degrees of freedom is defined as the solution to

The required is found by using the relationship between a -distribution and a gamma distribution, i.e., a -distribution with degrees of freedom is equal to a gamma distribution with scale parameter and shape parameter .

For very large values of , greater than , Wilson and Hilferty’s normal approximation to the is used; see Kendall and Stuart (1969).

References

Best, D J and Roberts, D E, 1975, Algorithm AS 91. The percentage points of the distribution, Appl. Statist. (24), 385–388

Hastings, N A J and Peacock, J B, 1975, Statistical Distributions, Butterworth

Kendall, M G and Stuart, A, 1969, The Advanced Theory of Statistics (Volume 1), (3rd Edition), Griffin