A user recently emailed this question:
I have a question about how a gamma probability distribution is implemented in ST-Sim. A gamma distribution is characterized by two parameters: a shape parameter (k) and a rate parameter (beta). However, ST-Sim only allows input of Mean and Standard Deviation as parameters that characterize a gamma distribution.
Should I:
(1) be substituting k and beta values in for the mean and standard deviation if I want to use a gamma probability distribution? Or…
(2) is ST-Sim converting mean and SD to the shape and rate parameters internally? In other words, I provide the ‘moments’ (mean and SD) and ST-Sim somehow converts these moments to shape and rate. Thanks.
Answer:
The second option is correct. You provide the mean and standard deviation and the shape and rate parameters are calculated internally according to the following formulas:
k = (mu / sigma)^2
θ = sigma^2 / mu
where:
k is the Shape;
θ is the Scale;
1/θ is the Rate;
mu is the Mean; and
sigma is the Standard Deviation