Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

gengammaUC

Generalized Gamma Distribution


Description

Density, distribution function, quantile function and random generation for the generalized gamma distribution with scale parameter scale, and parameters d and k.

Usage

dgengamma.stacy(x, scale = 1, d, k, log = FALSE)
pgengamma.stacy(q, scale = 1, d, k,
                lower.tail = TRUE, log.p = FALSE)
qgengamma.stacy(p, scale = 1, d, k,
                lower.tail = TRUE, log.p = FALSE)
rgengamma.stacy(n, scale = 1, d, k)

Arguments

x, q

vector of quantiles.

p

vector of probabilities.

n

number of observations. Same as in runif.

scale

the (positive) scale parameter b.

d, k

the (positive) parameters d and k. Both can be thought of as shape parameters, where d is of the Weibull-type and k is of the gamma-type.

log

Logical. If log = TRUE then the logarithm of the density is returned.

lower.tail, log.p

Same meaning as in pnorm or qnorm.

Details

See gengamma.stacy, the VGAM family function for estimating the generalized gamma distribution by maximum likelihood estimation, for formulae and other details. Apart from n, all the above arguments may be vectors and are recyled to the appropriate length if necessary.

Value

dgengamma.stacy gives the density, pgengamma.stacy gives the distribution function, qgengamma.stacy gives the quantile function, and rgengamma.stacy generates random deviates.

Author(s)

T. W. Yee and Kai Huang

References

Stacy, E. W. and Mihram, G. A. (1965). Parameter estimation for a generalized gamma distribution. Technometrics, 7, 349–358.

See Also

Examples

## Not run:  x <- seq(0, 14, by = 0.01); d <- 1.5; Scale <- 2; k <- 6
plot(x, dgengamma.stacy(x, Scale, d = d, k = k), type = "l",
     col = "blue", ylim = 0:1,
     main = "Blue is density, orange is cumulative distribution function",
     sub = "Purple are 5,10,...,95 percentiles", las = 1, ylab = "")
abline(h = 0, col = "blue", lty = 2)
lines(qgengamma.stacy(seq(0.05, 0.95, by = 0.05), Scale, d = d, k = k),
      dgengamma.stacy(qgengamma.stacy(seq(0.05, 0.95, by = 0.05),
                                      Scale, d = d, k = k),
            Scale, d = d, k = k), col = "purple", lty = 3, type = "h")
lines(x, pgengamma.stacy(x, Scale, d = d, k = k), col = "orange")
abline(h = 0, lty = 2) 
## End(Not run)

VGAM

Vector Generalized Linear and Additive Models

v1.1-5
GPL-3
Authors
Thomas Yee [aut, cre], Cleve Moler [ctb] (author of several LINPACK routines)
Initial release
2021-01-13

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.