GenGammaDistrib {SGB} | R Documentation |
Generalized Gamma distribution
Description
Density and random generation of the generalized gamma distribution.
Usage
dggamma(x, shape1, scale, shape2)
rggamma(n, shape1, scale, shape2)
Arguments
x |
vector of positive values |
n |
number of simulated vectors |
shape1 |
overall shape parameter |
scale |
vector of scales. Should be of the same length as |
shape2 |
vector of Dirichlet parameters. Should be of the same length as |
Details
log density at x >0
:
log(shape1/scale) - lgamma(shape2) + (shape1*shape2-1)*log(x/scale) - (x/scale)^{shape1}
Value
dggamma: Generalized gamma density evaluated at x
rggamma: Generalized gamma random deviates
References
Stacy, E.W. (1962). "A Generalization of the Gamma Distribution." Annals of Mathematical Statistics 33(3): 1187-1192.
Johnson, N.L.; Kotz, S; Balakrishnan, N. (1994) Continuous Univariate Distributions, Volume 1, 2nd Edition. Wiley. ISBN 0-471-58495-9 (Section 17.8.7)
Examples
set.seed(12345)
u1 <- rggamma(10,2,1,1.4) # 10 random deviates with scale 1
set.seed(12345)
u <- rggamma(10,2,1:10,1.4) # 10 random deviates with scale 1:10, repectively
u
u/u1
dggamma(u,2,1:10,1.4)
[Package SGB version 1.0.1.1 Index]