next up previous index
Next: G102 Kolmogorov Distribution Up: CERNLIB Previous: G100 Upper Tail

G101 Inverse of Chi-Square Distribution

Routine ID: G101
Author(s): K.S. KölbigLibrary: MATHLIB
Submitter: Submitted: 15.10.1976
Language: FortranRevised: 15.03.1993

Function subprogram CHISIN calculates χ2(P,N) for a given probability P(χ2) and a given degree of freedom N, where

P(χ2|N) = {12NΓ({12}N)}∫0χ2(P,N) e-{12}tt{12}N-1 dt

and N ≥1 and 0 ≤P(χ2) < 1 .

Structure:

FUNCTION subprogram
User Entry Name: CHISIN
Files Referenced: Unit 6
External References: GAUSIN (G105), MTLMTR (N002), ABEND (Z035)

Usage:

In any arithmetic expression, CHISIN(P,N) has the value χ2(P,N) ,

where CHISIN and P are of type REAL, and N is of type INTEGER.

Method:

The method is described in Ref. 1. Note that there the complementary integral is taken.

Accuracy:

Approximately three to six digits are correct. The case N = 3 is the least accurate.

Error handling:

Error G101.1: P<0 or P ≥1 .
Error G101.2: N<1 .
In both cases, the function value is set equal to zero, and a message is written on Unit 6, unless subroutine MTLSET (N002) has been called.

This subprogram is based on an Algol60 procedure published in Ref. 1.

References:

  1. R.B. Goldstein, Algorithm 451, Chi-Square Quantiles, Collected Algorithms from CACM (1972)

G102


Janne Saarela
Mon Apr 3 15:06:23 METDST 1995