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.

Method Description
Gamma(x) or Gamma(z) (Overloaded.) Gamma function for real or complex argument.
LogGamma(x) or LogGamma(z) (Overloaded.) Natural logarithm of the Gamma function for real or complex argument.
LogGammaWithSign(x, out sign) Natural logarithm of the Gamma function for real argument. Returns the sign of the Gamma function in the second out parameter.
IncompleteGamma (Overloaded.) Incomplete Gamma function for two or three real arguments..
RegularizedGammaP(a,x) Regularized Gamma function of the first kind.
RegularizedGammaQ(a,x) Regularized Gamma function of the second kind.
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.

Overview
Introduction
Features
Documentation
QuickStart Samples
Sample Applications
Downloads
Get it now!
Download trial version
How to Buy
Search

"The Extreme Optimization Statistics Library for .NET is a major boon for those doing statistical work in .NET. I strongly recommend this product."
- Marc Brooks

"I have made it my mission to institutionalize the value of good API design.  I strongly believe that this is key to making developers more productive and happy on our platform. It is clear that you value good API design in your work, and take to heart developer productivity and synergy with the .NET framework."
- Brad Abrams,
Lead Program Manager, Microsoft.

This is a partial list of companies who are using our libraries:
ABB Robotics
Allstate
Applied Materials
Arcam
Astra Schedule
Babson College
Canadian Council on Learning
Canyon Associates
Caxton Associates
CECity
Constellation Energy
CreditSights
DeepOcean
Duke University
Dynamotive
Elecsoft
Engelhard Corporation
Epcor
Equipoise Software
Galileo International
GAM UK
Gammex
GlaxoSmithKline
Global Matrix
The Hartford
Infinera Corporation
Intel
JDS Uniphase
LaBranche & Co.
Learning & Skills Council
Jacobs Consultancy
Litman Gregory
Lucas Systems
Malvern Instruments
Medrio
Merck & Co.
Mintera.
Monitor Software
MorningStar
NanoString Technologies
Paletta Invent
Parametric Portfolio Associates
Prosanos
RATA Associates
RiskShield
Ramboll
Standard & Poor's
Strategic Analysis Corporation
Univ. of Alicante
Univ. of South Carolina
vielife
Xerox
US Army