Hey there! Ready to crunch some numbers? Let’s dive into the world of statistics! Feel Free to reach out any time Contact Us

Maximum Likelihood Estimator in exponential distribution

Maximum Likelihood Estimator in exponential distribution

 The pdf of exponential distribution is given as 

`f(x; \theta) = \frac{1}{\theta} e^{-x / \theta}, \quad x \geq 0, \, \theta > 0.`

The MLE estimator is given by considering the likelihood function 

`L(\theta ; X) = \prod_{i=1}^n f(x_i; \theta) = \prod_{i=1}^n \frac{1}{\theta} e^{-x_i / \theta}.`

`L(\theta; X) = \frac{1}{\theta^n} exp{-\sum_{i=1}^n x_i / \theta}.`

Now taking log both sides to make calculus easy 

`\log L(\theta) = \log \left( \frac{1}{\theta^n} exp({-\frac{\sum_{i=1}^n x_i}{\theta}}) \right).`

`\log L(\theta) = -n \log \theta - \frac{\sum_{i=1}^n x_i}{\theta}.`

Differentiating partially with respect to `theta` both sides 

`\frac{\partial \log L(\theta)}{\partial \theta} = -\frac{n}{\theta} + \frac{\sum_{i=1}^n x_i}{\theta^2}.`

Putting it equal to zero 

`-\frac{n}{\theta} + \frac{\sum_{i=1}^n x_i}{\theta^2} = 0.`

`\frac{\sum_{i=1}^n x_i}{\theta^2} = \frac{n}{\theta}.`

`\sum_{i=1}^n x_i = n \theta.`

`\hat \theta_{MLE}= \frac{\sum_{i=1}^n x_i}{n}.`

R

# R code to plot an exponential distribution curve

# Define the rate parameter (lambda = 1/theta)
lambda <- class="keyword" span="">as.numeric
(readline("Enter the rate parameter (lambda): ")) # Ensure lambda is positive if (lambda <= 0) { stop("Rate parameter lambda must be greater than 0.") } # Generate x values and compute corresponding density x <- class="keyword" span="">seq(0, 10, by = 0.01) y <- class="keyword" span="">dexp(x, rate = lambda) # Plot the exponential distribution curve plot( x, y, type = 'l', col = 'blue', lwd = 2, xlab = 'x', ylab = 'Density', main = paste("Exponential Distribution (lambda =", lambda, ")") ) grid(col = 'gray')

Exponential Curve

Post a Comment

Oops!
It seems there is something wrong with your internet connection. Please connect to the internet and start browsing again.
Site is Blocked
Sorry! This site is not available in your country.