Learn R Programming

lmom (version 1.1)

cdfgam: 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).

Value

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

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.

See Also

gamma for the gamma function. pgamma for the standard Rversion of the gamma distribution. cdfpe3 for the Pearson type III distribution, which generalizes the gamma distribution.

Examples

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

Run the code above in your browser using DataLab