Extreme Optimization >
Mathematics Library for .NET >
User's Guide >
Current Page >
Gamma and Related Functions - Special Functions
Extreme Optimization Mathematics Library for .NET
Gamma and Related Functions
The Gamma function, G(x) is a generalization of the factorial. It is
defined as
The GammaFunctions class contains static methods for evaluating the
Gamma function and its variants, including Beta functions and the Digamma
function.
Gamma functions
The
Gamma method evaluates the standard Gamma function. The
LogGamma method evaluates the natural logarithm of (the
absolute value of) the Gamma function. Both methods have overloads for
real and complex arguments. In addition, the
LogGammaWithSign method returns the same value as LogGamma,
but has an extra ref parameter sign. On exit, this
parameter contains the sign of the Gamma function.
The incomplete Gamma function is defined as
It is implemented as the
IncompleteGamma method. Allowing the upper
bound of the integral to vary as well leads to a second variant of
IncompleteGamma that takes three parameters.
The regularized Gamma functions are defined by
and implemented by the RegularizedGammaP and RegularizedGammaQ
methods. Table 1 summarizes the methods that implement Gamma functions.
Table 2. Gamma functions.
Beta functions
The Beta function is closely related to the Gamma function. It is defined as:
The Beta function is implemented by the
Beta method, which takes two real parameters. Also available
is the
LogBeta method, which returns the natural logarithm of the
Beta function. The incomplete Beta function and the regularized Beta function
have definitions that are analogous to the similarly named Gamma functions.
They are implemented by the
IncompleteBeta and
RegularizedBeta methods, respectively.
Other Gamma-related functions
The DiGamma function Psi(x) is the derivative of the logarithm of the
Gamma function. It is implemented by the
DiGamma method, with overloads for real and integer
arguments. When the argument is an integer, the following special relation
holds:
where ? is
Euler's constant and the second term is a so-called harmonic
number, also available through the
HarmonicNumber method.
The
TaylorCoefficient method evaluates the Taylor coefficient of
the specified degree for a specified value of the argument.
Copyright 2004-2008,
Extreme Optimization. All rights reserved.
Extreme Optimization, Complexity made simple, M#, and M
Sharp are trademarks of ExoAnalytics Inc.
Microsoft, Visual C#, Visual Basic, Visual Studio, Visual
Studio.NET, and the Visual Studio Logo are registered trademarks of Microsoft Corporation