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

In this problem, we will investigate how to find the MLE. Write out the mathemat

ID: 3180050 • Letter: I

Question

In this problem, we will investigate how to find the MLE. Write out the mathematical equation of the log-likelihood function. Why is it difficult to maximize this function directly? It turns out, finding the MLE analytically (via the standard approach of taking derivatives of the log-likelihood, setting it equal to 0, and solving) is impossible (as is finding the mean and variance of the MLE!). Good thing we have R! Write a function logic(alpha, stamp) that takes as input the parameter a and a sample of size n, and returns the log-likelihood of the sample evaluated at a. Write a function called find.mle(samp) that takes as input a sample of size n, and returns the MLE & MLE. If you want to verify that your function is correct, generate a random sample of size n = 20 with the following seed from the above pdf with a = 5 and verify that your find.mle() function returns a MLE = -5.70379:

Explanation / Answer

I write the R-command for a particular distribution. I used inverse weibull distribution to estimate the parameters by using nlm command

Assume that we have a data set or it can be generate because in real life application is a mostly observed things.

> rm(list=ls(all=TRUE))
> x=c(0.84,0.88,0.91,0.93,0.95,1.01,1.1,1.1,1.14,1.15,1.17,1.29,1.29,1.38,1.43,1.86,
+ 1.87,1.89,2.01,2.4,2.55,2.91,3.24,3.73,4.16,4.79,6.67,8.39,8.6,10.77)
> n=length(x)
> ######################### IWD ####################
> LogL1=function(th){
+ bt=th[1]; ld=th[2]
+ z1=n*(log(ld)+log(bt))-(1+bt)*sum(log(x))-ld*sum(x^(-bt))
+ return(-z1)
+ }
> M1=nlm(LogL1, c(3,2), hessian=T)
> Mbt1=M1$estimate[1]; Mld1=M1$estimate[2];
> Mbt1
[1] 1.854932
> Mld1
[1] 1.937413

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote