| Rgamma {UCS} | R Documentation |
Computes the regularized Gamma function and its inverse. Both the lower and the upper regularized Gamma function are supported, and the Gamma value can be scaled to a base 10 logarithm.
Rgamma(a, x, lower=TRUE, log=FALSE) Rgamma.inv(a, y, lower=TRUE, log=FALSE)
a |
a non-negative numeric vector, the parameter of the incomplete Gamma function |
x |
a non-negative numeric vector, the point at which the incomplete Gamma function is evaluated |
y |
a numeric vector, the values of the regularized Gamma function
(or their base 10 logarithms if log=TRUE) |
lower |
if TRUE, computes the lower regularized Gamma
function (default). Otherwise, computes the upper regularized Gamma
function. |
log |
if TRUE, the Gamma values are base 10 logarithms
(default: FALSE) |
The regularized Gamma functions scale the corresponding incomplete Gamma functions to the interval [0,1], by dividing through Γ(a). Thus, the lower regularized Gamma function is given by
P(a,x) = gamma(a,x) / Gamma(a)
and the upper regularized Gamma function is given by
Q(a,x) = Gamma(a,x) / Gamma(a)
Rgamma returns the (lower or upper) regularized Gamma
function with parameter a evaluated at point x.
Rgamma.inv returns the point x at which the (lower or
upper) regularized Gamma function with parameter a evaluates to
y.
Cgamma, Igamma, Cbeta,
Ibeta, Rbeta
## P(X >= k) for Poisson distribution with mean alpha alpha <- 5 k <- 10 Rgamma(k, alpha) # == ppois(k-1, alpha, lower=FALSE)