Skip to content
Prev 43780 / 398513 Next

rgamma question

Icabalceta, Jorge L. wrote:

            
Did you look at the help? From ?rgamma:

<quote>
Details:

      If 'scale' is omitted, it assumes the default value of '1'.

      The Gamma distribution with parameters 'shape' = a and 'scale' = s
      has density

                f(x)= 1/(s^a Gamma(a)) x^(a-1) e^-(x/s)

      for x > 0, a > 0 and s > 0. The mean and variance are E(X) = a*s
      and Var(X) = a*s^2.
</quote>

Then, depending how you define "alpha" and "beta" use the above to 
figure out how to use rgamma.

-sundar