GammaDist2: The Gamma Distribution

Description Usage Arguments Details Value Author(s) See Also

Description

Density, distribution function, quantile function and random generation for the Gamma distribution with parameters mean and variance, as opposed to the standard shape ans scale.

Usage

1
2
3
4
5
6
7
  rgamma2(n, mean, var)

  dgamma2(x, mean, var, log = FALSE)

  pgamma2(q, mean, var, lower.tail = TRUE, log.p = TRUE)

  qgamma2(p, mean, var, lower.tail = TRUE, log.p = FALSE)

Arguments

x

vector of quantiles

q

vector of quantiles

p

vector of probabilities

n

number of observations. If length(n) > 1, the length is taken to be the number required.

log

logical: if TRUE, probabilities/densities p are returned as log(p).

log.p

as for log

lower.tail

logical: if TRUE (default), probabilities are P[X <= x], otherwise, P[X > x].

mean

the mean of the distribution

var

the variance of the distribution

Details

The Gamma distribution with parameters shape = a and scale = s have a mean and variance of E(X) = a*s and Var(X) = a*s^2. Since Var(X) = E(X) * scale, thus scale = Var(X) / E(X) and shape = E(X) / scale.

Value

dgamma2 gives the density, pgamma2 gives the distribution function, qgamma2 gives the quantile function, and rgamma2 generates random deviates.

Invalid arguments will result in return value NaN, with a warning.

Author(s)

Mark Cowley, 19 July 2005

See Also

rgamma


drmjc/mjcstats documentation built on May 15, 2019, 2:41 p.m.