Thursday, August 13, 2009

gama function

gamma, gammainc, gammaln

Gamma functions

Syntax

  • Y = gamma(A)                Gamma function
    Y = gammainc(X,A) Incomplete gamma function
    Y = gammaln(A) Logarithm of gamma function

Definition

The gamma function is defined by the integral:

The gamma function interpolates the factorial function. For integer n:

  • gamma(n+1) = n! = prod(1:n)

The incomplete gamma function is:



Description

Y = gamma(A) returns the gamma function at the elements of A. A must be real.

Y = gammainc(X,A) returns the incomplete gamma function of corresponding elements of X and A. Arguments X and A must be real and the same size (or either can be scalar).

Y = gammaln(A) returns the logarithm of the gamma function, gammaln(A) = log(gamma(A)). The gammaln command avoids the underflow and overflow that may occur if it is computed directly using log(gamma(A)).


No comments:

Post a Comment