1. Using R program
using Fit an exponential distribution to mtcars$hp by MLE using fitdist() in package fitdistrplus.
–First, use attach(mtcars) or data(mtcars)
–Then use library(fitdistrplus)
- First install fitdistrplus package with install.packages(“fitdistrplus”)
–Use the fitdist() function, with “exp” (with the quotes) as an argument, to tell fitdistrplus to fit an exponential distribution
–Name the result so you can plot it with denscomp()
Plot fitted distribution using denscomp()
The exponential distribution has a single parameter (“rate”). What is the MLE estimate of rate for variable hp?
–Use print(fit_name) to see, where fit_name is whatever you named your fitsdist() result
–Ignore the standard error
Asnwer up to 6 decimal points