Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

I just need to know how to code in R for the following questions. You don\'t nee

ID: 3202074 • Letter: I

Question

I just need to know how to code in R for the following questions. You don't need to give me the answer, but please help me

how to code in R.

Data for Question 2

1. Simulate 100 observations from a gamma(a, B), using a, B of your choice. Compute the MLE of a, B using this data How well does it compare with the "true a, B that you have chosen 2. Download the attached CSV. file in your computer. This is data from a pareto distribution with density (a 1)1/ r 1, a 1. Use Note, if a 1, this function is negative and so cannot be density. If a 1, it is identically 0. If a 1, 1-a ada (a -1) So the correct density is (a -1)1/ra, T 1, a 1 xk-read. csv (''F:/STT862-2017/pareto-data csv to read the file into R. C I have the file in disk F and directory STT862 2017. You should substitute the appropriate directory where you have saved the file. Compute the MLE of a

Explanation / Answer

Rcode:

> library(MASS)
> x<-rgamma(n = 100,shape = 1,rate = 2)
> fitdistr(x = x,densfun = 'gamma')
shape rate   
0.9095831 1.9782550
(0.1123030) (0.3204405)

Here shape and rate parameters alpha and beta can be chose accordingly The estimated values of the shape and rate parameters can be obtainedby the fitdistr function from the MASS package which comes with R.

As we can see that the estimates are quite close to the population parameters. Since the sample size is not large enough the value is not accurate but as the sample size increases the estimates approaches close to the original population parameters.