The Poisson distribution is a very common probability distribution to model coun
ID: 3236969 • Letter: T
Question
The Poisson distribution is a very common probability distribution to model counts data for an interval. Let X_1, X_2, X_3, ..., X_n be n independent random variables with the Poisson probability distribution. The distribution function is given by Pr (X = x_i) = e^lambda lambda^xi/x_i !, x = 1, 2, ... n where lambda is the average number of events that are within the specified interval. The likelihood functionI(lambda|x) is given by L (lambda|x)^n_1 = 1 Pr (X = x_i) = e^-n lambda lambda^x 1 + x_2 + ... x_n/x_1! x_2! ... x_n the negative log-likelihood function is given by L(lambda|x)= n lambda-(x_1 + x_2 + -x_n) log(lambda) + log(x_1 !) + log(x_2!) + - log(x_n!) d. Write functions in r to compute the likelihood function and negative log-likelihood function for a given value of A. e. Using the likelihood function created in part d. produce the likelihood graph versus A. Use the range for A from 10 to 20. f. Using the negative log-likelihood function created in part d. and optima function find the optimum value and standard deviation for A. Use the starting value for lambda = 12.Explanation / Answer
For negative log likehood
x<-1:10
l<-NULL
neg<-function(lamda){
l<-lamda-(sum(x)*log(lamda))+sum(log(x))
l}
neg(3)
#For likehood function
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.