Re: incomplete gamma function

Rob Creecy (rcreecy@Census.GOV)
Mon, 05 Jan 1998 17:38:07 -0500


Try

icgamma <- function(a,z) {gamma(a)*(1-pgamma(z,a))}
Using the notation in Mathematica, Gamma[a,z] is the incomplete gamma
function Integral[t^(a-1) Exp[-t],{t,z,Infinity}], "a" is the "shape"
parameter
of the gamma distribution.

testing
gamma(10)
362880
icgamma(10,0)
362880
icgamma(10,100)
0
icgamma(10,10)
166173.5 (Mathematica gives 166174.)

Dongliang Zhuang wrote:

> Dear S+ users,
>
> Is there a program available to calculate the incomplete gamma function?
> Thanks in advance for any information.