1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61
|
SUBROUTINE cumgam(x,a,cum,ccum)
C**********************************************************************
C
C SUBROUTINE CUMGAM(X,A,CUM,CCUM)
C Double precision cUMulative incomplete GAMma distribution
C
C
C Function
C
C
C Computes the cumulative of the incomplete gamma
C distribution, i.e., the integral from 0 to X of
C (1/GAM(A))*EXP(-T)*T**(A-1) DT
C where GAM(A) is the complete gamma function of A, i.e.,
C GAM(A) = integral from 0 to infinity of
C EXP(-T)*T**(A-1) DT
C
C
C Arguments
C
C
C X --> The upper limit of integration of the incomplete gamma.
C X is DOUBLE PRECISION
C
C A --> The shape parameter of the incomplete gamma.
C A is DOUBLE PRECISION
C
C CUM <-- Cumulative incomplete gamma distribution.
C CUM is DOUBLE PRECISION
C
C CCUM <-- Compliment of Cumulative incomplete gamma distribution.
C CCUM is DOUBLE PRECISIO
C
C
C Method
C
C
C Calls the routine GRATIO.
C
C**********************************************************************
C
C ..
C .. Scalar Arguments ..
DOUBLE PRECISION a,x,cum,ccum
C ..
C .. External Routines ..
EXTERNAL gratio
C ..
C .. Executable Statements ..
IF (.NOT. (x.LE.0.0D0)) GO TO 10
cum = 0.0D0
ccum = 1.0D0
RETURN
10 CALL gratio(a,x,cum,ccum,0)
C Call gratio routine
RETURN
END
|