gamma¶
Purpose¶
Returns the value of the gamma function.
Format¶
-
g =
gamma
(x)¶ - Parameters
x (NxK matrix or N-dimensional array) – the values used to evaluate the gamma function.
- Returns
g (NxK matrix or N-dimensional array) – the value of the gamma function evaluated at x.
Remarks¶
For each element of x this function returns the integral
\[\int_{0}^{\infty}t^{(x−1)}e^{−t}dt\]
All elements of x must be positive and less than or equal to 169. Values of x greater than 169 will cause an overflow.
The natural log of gamma()
is often what is required and it can be
computed without the overflow problems of gamma()
using lnfact()
.