Jorge: If I have trouble understanding documentation with something like this, I make plots, e.g., of dgamma vs. x for different values for shape and rate or scale. hope this helps. spencer graves

Peter Dalgaard wrote:

"Icabalceta, Jorge L." <[EMAIL PROTECTED]> writes:



I was trying to generate random numbers with a gamma distribution. In R the
function is: rgamma(n, shape, rate = 1, scale = 1/rate). My question is that if
X~gamma(alpha, beta) and I want to generate one random number where do I
plug alpha and beta in rgamma? and, what is the meaning and use of rate?



Well, it depends on your definition of alpha and beta.... You need to match up your notation for the gamma density with that given on help(rgamma), which will also tell you what to do with them.

The "rate" argument just allows you to specify the scale as its
inverse. A large rate corresponds to a narrow distribution. I suspect
this is popular notation for interarrival distributions in queuing
theory.




______________________________________________ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

Reply via email to