Density, distribution function, quantile function, and random generation
for the gamma distribution with parameters mean
and cv
.
dgammaAlt(x, mean, cv = 1, log = FALSE)
pgammaAlt(q, mean, cv = 1, lower.tail = TRUE, log.p = FALSE)
qgammaAlt(p, mean, cv = 1, lower.tail = TRUE, log.p = FALSE)
rgammaAlt(n, mean, cv = 1)
vector of quantiles.
vector of quantiles.
vector of probabilities between 0 and 1.
sample size. If length(n)
is larger than 1, then length(n)
random values are returned.
vector of (positive) means of the distribution of the random variable.
vector of (positive) coefficients of variation of the random variable.
logical; if TRUE
, probabilities/densities
logical; if TRUE
(default), probabilities are
dgammaAlt
gives the density, pgammaAlt
gives the distribution function,
qgammaAlt
gives the quantile function, and rgammaAlt
generates random
deviates.
Invalid arguments will result in return value NaN
, with a warning.
Let shape=
scale=
mean=
cv=
dgammaAlt
, pgammaAlt
, qgammaAlt
, and
rgammaAlt
call the R functions dgamma
,
pgamma
, qgamma
, and rgamma
,
respectively, using the values for the shape
and scale
parameters
given by: shape <- cv^-2
, scale <- mean/shape
.
Forbes, C., M. Evans, N. Hastings, and B. Peacock. (2011). Statistical Distributions, Fourth Edition. John Wiley and Sons, Hoboken, NJ.
Johnson, N. L., S. Kotz, and N. Balakrishnan. (1994). Continuous Univariate Distributions, Volume 1. Second Edition. John Wiley and Sons, New York.
Singh, A., A.K. Singh, and R.J. Iaci. (2002). Estimation of the Exposure Point Concentration Term Using a Gamma Distribution. EPA/600/R-02/084. October 2002. Technology Support Center for Monitoring and Site Characterization, Office of Research and Development, Office of Solid Waste and Emergency Response, U.S. Environmental Protection Agency, Washington, D.C.
Singh, A., R. Maichle, and N. Armbya. (2010a). ProUCL Version 4.1.00 User Guide (Draft). EPA/600/R-07/041, May 2010. Office of Research and Development, U.S. Environmental Protection Agency, Washington, D.C.
Singh, A., N. Armbya, and A. Singh. (2010b). ProUCL Version 4.1.00 Technical Guide (Draft). EPA/600/R-07/041, May 2010. Office of Research and Development, U.S. Environmental Protection Agency, Washington, D.C.
GammaDist, egammaAlt
,
Probability Distributions and Random Numbers.
# NOT RUN {
# Density of a gamma distribution with parameters mean=10 and cv=2,
# evaluated at 7:
dgammaAlt(7, mean = 10, cv = 2)
#[1] 0.02139335
#----------
# The cdf of a gamma distribution with parameters mean=10 and cv=2,
# evaluated at 12:
pgammaAlt(12, mean = 10, cv = 2)
#[1] 0.7713307
#----------
# The 25'th percentile of a gamma distribution with parameters
# mean=10 and cv=2:
qgammaAlt(0.25, mean = 10, cv = 2)
#[1] 0.1056871
#----------
# A random sample of 4 numbers from a gamma distribution with
# parameters mean=10 and cv=2.
# (Note: the call to set.seed simply allows you to reproduce this example.)
set.seed(10)
rgammaAlt(4, mean = 10, cv = 2)
#[1] 3.772004230 1.889028078 0.002987823 8.179824976
# }
Run the code above in your browser using DataLab