$30
• Use statistical software R for your codes and only basic in built functions are allowed.
• Follow the labelling method for your files.
1. Consider a Gamma distribution with r = 5,λ = 2.
(a) Construct an algorithm to find maximum likelihood estimator.
(b) Simulate a random sample of size 1000 from Gamma (r = 5,λ = 2). Find the maximum likelihood estimate of the unknown parameters in R. Show the results by using three different sets of initial values, one of them would be the estimates obtained using method of moments.
(c) Taking r constant and equal to 5, plot the log likelihood for various values ofλ.
(d) Plot log likelihood functions for various values of r,λ.
2. The data of the height of males in the U.S. is given in attached (csv) file. Assume that the data follows Normal distribution.
(a) Based on the data, what will be the maximum likelihood estimate of theparameters.
(b) Show graphically that the likelihood function attains maxima at the aboveestimate.