Question: I need a python script Exercise 2 : Maximum Likelihood and least squares In the file exponential _ data.txt there are 1 0 0 0

I need a python script
Exercise 2: Maximum Likelihood and least squares
In the file exponential_data.txt there are 1000 decay time measurements between 0 and 5 s of muons, which have a mean lifetime of =2s. The PDF used to generate this data is:
P(t)=1*(1-e-5)*e-t
where is the mean decay time in s and t is the measured decay time.
(a) Calculate twice the negative-log-likelihood (2*NLL()) as a function of the lifetime . Shift the values of the 2*NLL() such that the minimum is zero and plot it for 1.8<<2.2 s.
(b) Bin the time measurements into a histogram of 40 equally sized bins, from 0 to 5s. Use the binned maximum likelihood method to calculate twice the negative-log-likelihood (2*NLL()) for these 40 bins as a function of . Shift the values of the 2*NLL such that the minimum is zero and overlay the plot with the unbinned calculation in part a). Does it matter if you approximate the integral (by using the mean of the bin) of the function when computing the prediction for each bin (fi)? Argue quantitatively and/or calculate and compare.
(c) Now create a 2 function and calculate the 2 as a function of . Plot it and overlay it on the NLL plot with the other two calculations in parts a) and b). Shift the 2 also such that the minimum is at zero. Compare the results.
(d) Bin the dataset into a wider histogram of 2 bins and calculate the binned 2.NLL and the 2 function again. How is the agreement now between them? How do they agree agree with the unbinned calculation in part a)?
\table[[exponential_data.txt],[2.36157335906],[4.3340095117],[1.54459209088],[1.02583149632],[1.52965487436],[3.52931068162],[1.09519676302],[0.144951827224],[4.55516567972],[0.41844374904],[0.844736157205],[1.74170326767],[1.53422145666],[1.74237962417],[2.8883874615],[3.98074912863],[0.536023747018],[1.49082363197],[2.81300952196],[1.98147935073],[3.35694304445],[0.675999872838],[0.359700293147],[4.00953762641],[0.700938858181],[0.842091012328],[0.0738584732608],[1.11884965612],[1.24849322578],[2.61514639864],[2.88810895792],[0.154439759353],[3.564019897],[0.741363677707]]

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!