Probability density function (PDF), cummulative density function (CDF), quantile function and random generation for the Three-Parameter Gamma (gamma3p) distribution.
dgamma3p(x, shape = 1, rate = 1, scale = 1/rate, mu = 0, log = FALSE)
pgamma3p(
q,
shape = 1,
rate = 1,
scale = 1/rate,
mu = 0,
lower.tail = TRUE,
log.p = FALSE
)
qgamma3p(
p,
shape = 1,
rate = 1,
scale = 1/rate,
mu = 0,
lower.tail = TRUE,
log.p = FALSE
)
rgamma3p(n, shape = 1, rate = 1, scale = 1/rate, mu = 0)
numeric vector
shape parameter, or slope, defaulting to 1
scale parameter, or characteristic life, defaulting to 1
location parameter (numerical, default 0).
logical; if TRUE (default), probabilities are P[X<=x], otherwise, P[X > x]
logical; if TRUE, probabilities/densities p are returned as log(p).
number of observations
Three-parameter PDF values for dgamma3p, three-parameter probability for pgamma3p, quantiles or three-parameter random generated values for rgamma3p.
It is important to mention that Gamma distribution is defined for \(x > 0\) and, therefore, values \(x < 0\) will yield probability zero. While to obtain negative random values with function rgamma3p is an indication that the location parameter \(\mu\) has not a valid value.
set.seed(123) # set a seed for random generation
## Sampling from the specified Gamma distribution
r <- rgamma3p(n = 1e5, shape = 1.4, scale = 3.7, mu = 0.9)
## The histogram and density
hist(r, 100, freq = FALSE, xlim = c(0, 20))
r1 <- seq(0, 20, by = 0.1)
lines(r1, dgamma3p(r1, shape = 1.4, scale = 3.7, mu = 0.9),
col = "red"
)