# $$\text{GammaCDF}$$¶

You can use the $$\text{GammaCDF}$$ function to calculate the cumulative distribution function (CDF) of the gamma distribution.

You can use the \gammac backslash command to insert this function.

The following variants of this function are available:

• $$\text{real } \text{GammaCDF} \left ( \text{<x>}, \text{<k>} \right )$$

• $$\text{real } \text{GammaCDF} \left ( \text{<x>}, \text{<k>}, \text{<}\theta\text{>} \right )$$

Where $$x$$, $$k$$, and $$\theta$$ are scalar values representing the value of interest, the shape term, and the scale term respectively. Note that this function is defined over the range $$x \geq 0$$, $$k > 0$$, and $$\theta > 0$$ and will generate an error or return NaN for values for which the function is not defined.

The $$\theta$$ term is optional. The value 1 will be used if the $$\theta$$ term is not provided.

The value is calculated directly using the relation:

$\text{GammaCDF} \left ( x, k, \theta \right ) = \text{P} \left ( k, \frac{ x }{ \theta } \right )$

Where $$\text{P}$$ is the regularized lower gamma function defined by:

$\text{P} \left ( s, x \right ) = \frac{\gamma \left ( s, x \right )}{\Gamma \left ( s \right )}$

The gamma distribution can be viewed as the sum of $$k$$ identical and independent exponential distributions, each with rate $$\frac{1}{\theta}$$. The exponential distribution is therefore the special case of the gamma distribution with $$k = 1$$. Similarly, the gamma distribution is also equivalent to the Erlang distribution when $$k$$ is an integer value.

The gamma distribution is identical to the chi-squared distribution with $$v$$ degrees of freedom when $$k = \frac{1}{2} v$$ and $$\theta = 2$$.

Figure 141 shows the basic use of the $$\text{GammaCDF}$$ function. Figure 141 Example Use Of the GammaCDF Function