Evaluates the gamma cumulative probability distribution function.

Namespace: Imsl.Stat
Assembly: ImslCS (in ImslCS.dll) Version: 6.5.0.0

Syntax

C#
public static double Gamma(
	double x,
	double a
)
Visual Basic (Declaration)
Public Shared Function Gamma ( _
	x As Double, _
	a As Double _
) As Double
Visual C++
public:
static double Gamma(
	double x, 
	double a
)

Parameters

x
Type: System..::.Double
A double scalar value representing the argument at which the function is to be evaluated.
a
Type: System..::.Double
A double scalar value representing the shape parameter. This must be positive.

Return Value

A double scalar value representing the probability that a gamma random variable takes on a value less than or equal to x.

Remarks

Method Cdf.Gamma evaluates the distribution function, F, of a gamma random variable with shape parameter a; that is,

F\left(x\right)=\frac{1}{{\Gamma\left(a
            \right)}}\int_0^x{e^{-t}t^{a-1}}dt

where \Gamma(\cdot) is the gamma function. (The gamma function is the integral from 0 to 
            \infty of the same integrand as above). The value of the distribution function at the point x is the probability that the random variable takes a value less than or equal to x.

The gamma distribution is often defined as a two-parameter distribution with a scale parameter b (which must be positive), or even as a three-parameter distribution in which the third parameter c is a location parameter. In the most general case, the probability density function over (c,
            \infty) is

f\left(t\right)=\frac{1}{{b^a\Gamma
            \left(a\right)}}e^{-\left({t-c}\right)/b}\left({x-c}\right)^{a-1}

If T is such a random variable with parameters a, b, and c, the probability that 
            T\le t_0 can be obtained from Cdf.Gamma by setting X=(t_0-c)/b.

If X is less than a or if X is less than or equal to 1.0, Cdf.Gamma uses a series expansion. Otherwise, a continued fraction expansion is used. (See Abramowitz and Stegun, 1964.)

Gamma Distribution Function

See Also