# Method of Moment for Gamma Distribution

I know that the empirical $$r$$-th moment is defined as:

$$\hat E(X^r) = \frac{1}{n} \sum_{i=1}^n x_i^r$$

So for the first moment I did: $$E_{\lambda,\alpha}(X) = \hat E(X) = \bar X$$ $$\bar X = \frac{\alpha}{\lambda}$$ $${\alpha}=\lambda \bar X$$

For the second moment: \begin{align}E_{\alpha,\lambda}(X^2) & = \hat E[X^2] \\ & = \frac{(\alpha + 1) \alpha}{\lambda^2}\\ & = \frac{(\lambda \bar X + 1) \lambda \bar X }{\lambda^2}\\ & = \lambda \bar X^2 + \bar X = \lambda \frac{1}{n} \sum_{i=1}^n x_i^2 \end{align}

Know, this is where I´m stuck, I know for a fact, that the end equation must be, but I´m not sure how:

$$\lambda = \frac{\bar X}{ \frac{1}{n}\sum_{i=1}^n x_i^2 - \bar X^2}$$

• Please type your question as text, do not just post a photograph or screenshot (see here). When you retype the question, add the self-study tag & read its wiki. Then tell us what you understand thus far, what you've tried & where you're stuck. We'll provide hints to help you get unstuck. Please make these changes as just posting your homework & hoping someone will do it for you is grounds for closing. – kjetil b halvorsen Apr 28 at 23:57
• @kjetilbhalvorsen How do I write math notation? And I don't get what else you want me to write, I just show you everything I did, the only thing they gave me was the equation that I had to get at the end – René Martínez Apr 29 at 0:09
• For writing math notation see math.meta.stackexchange.com/questions/5020/… – kjetil b halvorsen Apr 29 at 0:10
• This is way wrong from the first line. E(X) is a parameter, and x-bar is a statistic. We use statistics to estimate parameters, but clearly understanding the distinction between statistics and parameters is fundamental to statistical thinking. Get that straight before trying to go any further. – Russ Lenth Apr 29 at 0:36
• The mean of the dats is not the same as the mean of the distribution. The latter is unvarying, but the mean of the data changes when you get a different set of data. – Russ Lenth Apr 29 at 2:30

In the sequence \begin{align}E_{\alpha,\lambda}(X^2) & = \frac{(\alpha + 1) \alpha}{\lambda^2}\\ & = \frac{(\lambda \bar X + 1) \lambda \bar X }{\lambda^2}\tag{1}\\ & = \lambda \bar X^2 + \bar X \tag{2}\\ & = \hat E[X^2] \\ & = \lambda \frac{1}{n} \sum_{i=1}^n x_i^2 \tag{3} \end{align} there is a mistake in (1), which makes (2) wrong. And there is an extra $$\lambda$$ in (3).