part (a)
First, I want to say that I am using the following defintion of the Gamma function (using instead of ) in the defintion. Since The data given has units of time and are not rate (i.e. 1/time). So I am using this definition of Gamma PDF
Now to answer part (A).
Yes. The following shows the histogram of the data, and a plot of a Gamma distribution with the shape parameter and scale parameter set to the average of the data.
Part(b)
Using method of moments. We need 2 equations since we have to estimate 2 parameters For Gamma
Now from the data itself, calculate the First and Second moments and equate to the above and solve for and these will be our estimate. This little code does the above
Now using the MLE method. For
Hence we obtain the 2 equations
From the second equation, set it to zero we obtain
Substitute the above in the first equation and set to zero we obtain
And solve for . Once we find we then find also
This code below does the above.
Part(C)
Now Fit this model again, and compare the MLE fitting to the method of moments fitting
This plot shows more closely the fitting on top of each others. They are very close so hard to see the difference other than near the high frequency part.
The fits above both look reasonable.
___________________________________________________________________________________________________________________________
Part(d)
Use bootstrap method.
For the method of moments.
Try for be the same size Use the method of moments parameters to generate an random variables from Gamma distribution. First time use the parameters estimated from the data as shown above.
Now, use the sample generated above to estimate the parameters from it again using also the method of moments. Use these parameters to generate another random variables. repeat this process for say and find the variances of the parameters , and hence we find the standard error which is the square root of these variances.
Here is the code to do the above and the result
(Last minute update), I am getting large result for standard error from the bootstrap method. I think I have something wrong. Here is the result I get and the code
For Method of moments, I get standard error for alpha=918 and for lambda=18
For MLE I get
Standard error for alpha=1.68697*10^8
Standard error for lambda=60.2585
Part (e) and (f)
sorry, run out of time.