View source: R/distributions.R
mom_gamma | R Documentation |
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)
mean |
Mean of the random variable. |
sd |
Standard deviation of the random variable. |
scale |
Logical. If TRUE (default), then the scale parameter is returned; otherwise, the rate parameter is returned. |
If μ is the mean and
σ is the standard deviation of the random variable, then the method
of moments estimates of the parameters shape
= α > 0 and
scale
= θ > 0 are:
θ = \frac{σ^2}{μ}
and
α = \frac{μ}{θ}
The inverse of the scale parameter, β = 1/θ, is the rate parameter.
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
.
mom_gamma(mean = 10000, sd = 2000) # The function is vectorized. mom_gamma(mean = c(8000, 10000), sd = c(1500, 2000))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.