e) Mathematically, the MLE for λ, is 1 ̄x = 3.2634033, which we expected. Using R and optimize(), compute the maximum of the likelihood function from a computer science standpoint. f) Plot and optimize the log-likelihood function as well. Where is the location of the maximum?   Please solve this with R code

MATLAB: An Introduction with Applications
6th Edition
ISBN:9781119256830
Author:Amos Gilat
Publisher:Amos Gilat
Chapter1: Starting With Matlab
Section: Chapter Questions
Problem 1P
icon
Related questions
Question

e)

Mathematically, the MLE for λ, is 1

̄x = 3.2634033, which we expected. Using R and optimize(), compute

the maximum of the likelihood function from a computer science standpoint.

f)

Plot and optimize the log-likelihood function as well. Where is the location of the maximum?

 

Please solve this with R code

Next on your own you'll plot the likelihood based on exponential data.
a)
First, write and simplify the likelihood function for a data set of exponentially distributed random variables.
Use LaTeX math typesetting notation to make your likelihood render correctly.
b)
Next, consider observations from an exponential distribution where X is a the parameter. Code up a function
L_Exponential, similar to the L_Poisson from class and L_Normal from problem 1, that will take an input
vector of possible λs, an input vector of observed data, and compute and output the evaluated likelihood
value. Be cautious with parentheses.
c)
Suppose we observe a data set of heavy metal concentrations, in micrograms of mercury per liter, of wa-
ter specimens collected in the Olentangy River basin: c(0.51, 0.02, 0.15, 0.46, 0.11, 0.04, 0.39,
0.52, 0.2, 0.17, 0.01, 0.02, 0.32, 1.37). Suppose concentrations can be assumed to be exponen-
tially distributed. Compute x, the MLE for X.
mercury <-c(0.51, 0.02, 0.15, 0.46, 0.11, 0.04, 0.39, 0.52, 0.2, 0.17, 0.01, 0.02, 0.32, 1.:
xbar <- mean (mercury)
print (xbar)
## [1] 0.3064286
d)
Plot the likelihood function for this particular data set over the λ domain (0, 10]. Comment on the shape of
the likelihood function and the apparent location of the maximum.
Transcribed Image Text:Next on your own you'll plot the likelihood based on exponential data. a) First, write and simplify the likelihood function for a data set of exponentially distributed random variables. Use LaTeX math typesetting notation to make your likelihood render correctly. b) Next, consider observations from an exponential distribution where X is a the parameter. Code up a function L_Exponential, similar to the L_Poisson from class and L_Normal from problem 1, that will take an input vector of possible λs, an input vector of observed data, and compute and output the evaluated likelihood value. Be cautious with parentheses. c) Suppose we observe a data set of heavy metal concentrations, in micrograms of mercury per liter, of wa- ter specimens collected in the Olentangy River basin: c(0.51, 0.02, 0.15, 0.46, 0.11, 0.04, 0.39, 0.52, 0.2, 0.17, 0.01, 0.02, 0.32, 1.37). Suppose concentrations can be assumed to be exponen- tially distributed. Compute x, the MLE for X. mercury <-c(0.51, 0.02, 0.15, 0.46, 0.11, 0.04, 0.39, 0.52, 0.2, 0.17, 0.01, 0.02, 0.32, 1.: xbar <- mean (mercury) print (xbar) ## [1] 0.3064286 d) Plot the likelihood function for this particular data set over the λ domain (0, 10]. Comment on the shape of the likelihood function and the apparent location of the maximum.
Expert Solution
steps

Step by step

Solved in 3 steps with 12 images

Blurred answer
Similar questions
Recommended textbooks for you
MATLAB: An Introduction with Applications
MATLAB: An Introduction with Applications
Statistics
ISBN:
9781119256830
Author:
Amos Gilat
Publisher:
John Wiley & Sons Inc
Probability and Statistics for Engineering and th…
Probability and Statistics for Engineering and th…
Statistics
ISBN:
9781305251809
Author:
Jay L. Devore
Publisher:
Cengage Learning
Statistics for The Behavioral Sciences (MindTap C…
Statistics for The Behavioral Sciences (MindTap C…
Statistics
ISBN:
9781305504912
Author:
Frederick J Gravetter, Larry B. Wallnau
Publisher:
Cengage Learning
Elementary Statistics: Picturing the World (7th E…
Elementary Statistics: Picturing the World (7th E…
Statistics
ISBN:
9780134683416
Author:
Ron Larson, Betsy Farber
Publisher:
PEARSON
The Basic Practice of Statistics
The Basic Practice of Statistics
Statistics
ISBN:
9781319042578
Author:
David S. Moore, William I. Notz, Michael A. Fligner
Publisher:
W. H. Freeman
Introduction to the Practice of Statistics
Introduction to the Practice of Statistics
Statistics
ISBN:
9781319013387
Author:
David S. Moore, George P. McCabe, Bruce A. Craig
Publisher:
W. H. Freeman