
Calculate shape and scale (or rate) parameters of a gamma distribution.
Source:R/gen_psa_samp.R
gamma_params.RdFunction to calculate the shape, \(\alpha\), and scale, \(\theta\), (or rate, \(\beta\)) parameters of a gamma distribution based on the method of moments (MoM) using the mean \(\mu\) and standard deviation \(\sigma\) of the random variable of interest.
Value
A list containing the following:
shape Shape parameter of gamma distribution
scale Scale parameter of gamma distribution (If scale=TRUE)
rate Rate parameter of gamma distribution (If scale=FALSE)
Details
Based on method of moments. If \(\mu\) is the mean and \(\sigma\) is the standard deviation of the random variable, then the the shape, \(\alpha\), scale, \(\theta\), and rate, \(\beta\), parameters are computed as follows $$\alpha=\frac{\mu^2}{\sigma^2},$$ $$\theta = \frac{\sigma^2}{\mu}$$ and $$\beta = \frac{\mu}{\sigma^2}$$