   7.4.9  The gamma distribution

The probability density function for the gamma distribution: gammad

The gamma distribution depends on two parameters, a>0 and b>0; the value of the density function at x ≥ 0 is gammad(a,b,x) = xa−1ebxba/Γ(a). If you enter

for example, you will get

3/exp(3)

The cumulative distribution function for the gamma distribution: gammad_cdf

The cumulative distribution function for the gamma distribution with parameters a and b at a value x is gammad_cdf(n,x) = Prob(Xx). It turns out that gammad_cdf(n,x) = igamma(a, bx, 1) where igamma is the incomplete gamma function; igamma(a,x,1) = ∫0x etta−1dt/Γ(a). If you enter

you will get

0.090204010431

If you give gammad_cdf an extra argument, you will get the probability that the random variable lies between two values; gammad_cdf(a,b,x,y) = Prob(xXy). If you enter

you will get

0.351970589198

The inverse distribution function for the gamma distribution: gammad_icdf

The inverse distribution function for the gamma distribution with parameters a and b is computed with gammad_icdf(a,b,h); recall that this will return the value x with gammad_cdf(a,b,x) = h. If you enter   