Solved – Confused about Gamma distribution parameters in R

I would like to draw a Gama distribution in R but Im confused since it has different notations.

Mine is in the form:

$ theta^alpha x^{alpha-1}e^{-theta x} / Gamma(alpha) $

Let's say for example that $alpha = 5$

Is this the correct way to represent it?:

curve(dgamma(x, scale=1, shape=5),from=0, to=100, main="Gamma distribution") 

shape is $alpha$ , im not sure what scale is or what the 'x' does.

Thank you

Following the standard notation you should define the scale parameter as $1/theta$.

Of course in this case it makes no difference because $theta = 1$ but in general when you write the pdf of the gamma distribution the way you did, $theta$ is called rate paramenter and not scale parameter.

This is also made clear in the R documentation for the function:

dgamma 

here

About x insted .. "what x does" is nothing.

x represents the point where you evaluate the pdf.

If you have a sample from a gamma distribution all $x_1,x_2,…,x_n$ are your sample points.

Similar Posts:

Rate this post

Leave a Comment