Suppose we are given a random sample $x_1, \dots ,x_n$ from a Gamma distribution. I.e., $ x_i \sim G(3,\beta)$, $i = 1,\dots ,n.$
Find the method of moments estimator and the maximum likelihood estimator of $\beta$
How do I solve this question for gamma distribution, what are the steps?
The Gamma distribution of parameters $\alpha>0$ and $\beta>0$ is has as a density function the following:
$\frac{1}{\Gamma(\alpha)\beta^\alpha}x^{\alpha-1}e^{-\frac{x}{\beta}},\quad 0<x<\infty$
You can check that the expected value of $X\sim Gamma(\alpha,\beta)$ is $\mathrm{E}[X]=\beta\alpha$. With that information plus the formula for the sample mean, that is $\overline{X}= \frac{1}{n}\sum_{i=1}^nX_i$. We can find the method of moments estimator. In your problem, the parameter unknown is $\beta$ since $\alpha=3$, so the method of moments is basically solving the equation
$\mathrm{E}[X]=\overline{X}$
for the parameter $\beta$. Subtitute the value $\alpha=3$ and you get the desired estimator:
$\hat{\beta}=\frac{\overline{X}}{3}$
Now to find the maximum likelihood estimator, first we need to find $L(\beta|x_1,...x_n)$ which is the density function of our sample. In our case, that function is (substitution $\alpha=3$ made):
$L(\beta|x_1,...x_n)=(\frac{1}{\Gamma(3)^n})(\frac{1}{\beta^3})^n(\prod_{i=1}^nx_i)^2e^{-\frac{1}{\beta}\sum_{i=1}^nx_i}$
Taking logarithms, we get:
$logL(\beta|x_1,...x_n)=-nlog\Gamma(3)-2nlog\beta+2\sum_{i=1}^nlog(x_i)-\frac{1}{\beta}\sum_{i=1}^nx_i$
Now, in order to find our maximum likelihood estimator, we need to solve the equation $\frac{d}{d\beta}L(\beta|x_1,...x_n)=0$. Which is the same as solving:
$0=\frac{1}{\beta}(-3n+\frac{1}{\beta}\sum_{i=1}^nx_i)$
And finally we can solve that equation for $\beta$ to get
$\hat{\beta}=\frac{\sum_{i=1}^nx_i}{3n}=\frac{\overline{X}}{3}$
which is actually the estimator we found using the method of moments estimation.