cdfgam: Gamma distribution

View source: R/lmom.r

cdfgamR Documentation

Gamma distribution

Description

Distribution function and quantile function of the gamma distribution.

Usage

cdfgam(x, para = c(1, 1))
quagam(f, para = c(1, 1))

Arguments

x

Vector of quantiles.

f

Vector of probabilities.

para

Numeric vector containing the parameters of the distribution, in the order \alpha, \beta (shape, scale).

Details

The gamma distribution with shape parameter \alpha and scale parameter \beta has probability density function

f(x)={x^{\alpha-1} \exp(-x/\beta) \over \beta^\alpha \Gamma(\alpha)}

for x\ge0, where \Gamma(.) is the gamma function.

Value

cdfgam gives the distribution function; quagam gives the quantile function.

Note

The functions expect the distribution parameters in a vector, rather than as separate arguments as in the standard R functions pgamma and qgamma.

See Also

gamma for the gamma function.

pgamma for the standard R version of the gamma distribution.

cdfpe3 for the Pearson type III distribution, which generalizes the gamma distribution.

Examples

# Random sample from the gamma distribution
# with shape parameter 4 and mean 1.
quagam(runif(100), c(4,1/4))

lmom documentation built on Oct. 1, 2024, 1:08 a.m.