Next: , Previous: , Up: Functions and Variables for continuous distributions   [Contents][Index]

52.2.9 Gamma Random Variable

The gamma distribution is a two-parameter family of probability distributions. Maxima uses the parameterization using the shape and scale for the first and second parameters of the distribution.

Function: pdf_gamma (x,a,b)

Returns the value at x of the density function of a Γ(a,b) random variable, with a,b>0. To make use of this function, write first load("distrib").

The shape parameter is a, and the scale parameter is b.

The pdf is

f(x;a,b)=xa1ex/bbaΓ(a)
Categories: Package distrib ·
Function: cdf_gamma (x,a,b)

Returns the value at x of the distribution function of a Γ(a,b) random variable, with a,b>0.

The cdf is

F(x;a,b)={1Q(a,xb)for x00for x<0

where Q(a,z) is the gamma_incomplete_regularized function.

(%i1) load ("distrib")$
(%i2) cdf_gamma(3,5,21);
                                                 1
(%o2)        1 - gamma_incomplete_regularized(5, -)
                                                 7
(%i3) float(%);
(%o3)                 4.402663157376807e-7
Categories: Package distrib ·
Function: quantile_gamma (q,a,b)

Returns the q-quantile of a Γ(a,b) random variable, with a,b>0; in other words, this is the inverse of cdf_gamma. Argument q must be an element of [0,1]. To make use of this function, write first load("distrib").

Categories: Package distrib ·
Function: mean_gamma (a,b)

Returns the mean of a Γ(a,b) random variable, with a,b>0. To make use of this function, write first load("distrib").

The mean is

E[X]=ab
Categories: Package distrib ·
Function: var_gamma (a,b)

Returns the variance of a Γ(a,b) random variable, with a,b>0. To make use of this function, write first load("distrib").

The variance is

V[X]=ab2
Categories: Package distrib ·
Function: std_gamma (a,b)

Returns the standard deviation of a Γ(a,b) random variable, with a,b>0. To make use of this function, write first load("distrib").

The standard deviation is

D[X]=ba
Categories: Package distrib ·
Function: skewness_gamma (a,b)

Returns the skewness coefficient of a Γ(a,b) random variable, with a,b>0. To make use of this function, write first load("distrib").

The skewness coefficient is

SK[X]=2a
Categories: Package distrib ·
Function: kurtosis_gamma (a,b)

Returns the kurtosis coefficient of a Γ(a,b) random variable, with a,b>0. To make use of this function, write first load("distrib").

The kurtosis coefficient is

KU[X]=6a
Categories: Package distrib ·
Function: random_gamma (a,b)
    random_gamma (a,b,n)

Returns a Γ(a,b) random variate, with a,b>0. Calling random_gamma with a third argument n, a random sample of size n will be simulated.

The implemented algorithm is a combination of two procedures, depending on the value of parameter a:

For a>=1, Cheng, R.C.H. and Feast, G.M. (1979). Some simple gamma variate generators. Appl. Stat., 28, 3, 290-295.

For 0<a<1, Ahrens, J.H. and Dieter, U. (1974). Computer methods for sampling from gamma, , poisson and binomial cdf_tributions. Computing, 12, 223-246.

To make use of this function, write first load("distrib").


Next: , Previous: , Up: Functions and Variables for continuous distributions   [Contents][Index]

JavaScript license information