Investment Studio > Expressions > Functions > Statistical > GAMMADIST

float gammadist(float x, float alpha, float beta, boolean cumulative)

Returns the gamma probability function.

x must be >= 0.

alpha and beta must be > 0.

If cumulative = TRUE, the CDF (Cumulative Distribution Function) is returned (equal to the probability that x is >= a stochastic variable with exponential distribution); otherwise, the PDF (Probability Density Function) is returned.

Mathematically, the gamma PDF is

  xa-1 e-x/b
f(x, a, b) =  ¾¾¾¾
  ba G(a)

and the CDF is

  x  
F(x, a, b) =  ó f(u, a, b) du
ô
õ
  0  

For integer a > 0, the gamma distribution is the distribution of the sum of a independent, exponentially distributed stochastic variables with l = 1 / b (see expondist), also known as the Erlang distribution.

Setting a = 1 yields the exponential distribution with l = 1 / b. Also,

gammadist(x, n/ 2, 2, TRUE) = 1 - chidist(x, n, TRUE)

The standard gamma distribution described in most statistical texts is obtained by setting b = 1.

Example

=gammadist(9, 8, 3, FALSE)

returns 0.00720134381749461.

=gammadist(9, 8, 3, TRUE)

returns 0.0119045038561503.

See also chidist, expondist, gamma, gammainv, gammaln.