powered by
Density, distribution function, quantile function, and random generation for the gamma distribution reparameterised in terms of mean and standard deviation.
dgamma2(x, mean = 1, sd = 1, log = FALSE)pgamma2(q, mean = 1, sd = 1, lower.tail = TRUE, log.p = FALSE)qgamma2(p, mean = 1, sd = 1, lower.tail = TRUE, log.p = FALSE)rgamma2(n, mean = 1, sd = 1)
pgamma2(q, mean = 1, sd = 1, lower.tail = TRUE, log.p = FALSE)
qgamma2(p, mean = 1, sd = 1, lower.tail = TRUE, log.p = FALSE)
rgamma2(n, mean = 1, sd = 1)
dgamma2 gives the density, pgamma2 gives the distribution function, qgamma2 gives the quantile function, and rgamma2 generates random deviates.
dgamma2
pgamma2
qgamma2
rgamma2
vector of quantiles
mean parameter, must be positive.
standard deviation parameter, must be positive.
logical; if TRUE, probabilities/ densities \(p\) are returned as \(\log(p)\).
TRUE
logical; if TRUE, probabilities are \(P[X \le x]\), otherwise, \(P[X > x]\).
vector of probabilities
number of random values to return.
This implementation allows for automatic differentiation with RTMB.
RTMB
x <- rgamma2(1) d <- dgamma2(x) p <- pgamma2(x) q <- qgamma2(p)
Run the code above in your browser using DataLab