Compute the shape and scale (or rate) parameters of the gamma distribution using method of moments for the random variable of interest.
mom_gamma(mean, sd, scale = TRUE)
If scale = TRUE
, then a list containing the parameters shape
and scale
; otherwise,
if scale = FALSE
, then a list containing the parameters shape
and rate
.
Mean of the random variable.
Standard deviation of the random variable.
Logical. If TRUE (default), then the scale parameter is returned; otherwise, the rate parameter is returned.
If shape
= scale
=
The inverse of the scale parameter,
mom_gamma(mean = 10000, sd = 2000)
# The function is vectorized.
mom_gamma(mean = c(8000, 10000), sd = c(1500, 2000))
Run the code above in your browser using DataLab