In the Week 2 exercises, the iMinuit errordef attribute is explicitly redefined as 0.5 several time in the following files,
|
"minuit_bllh.errordef = 0.5 # Value for likelihood fits\n", |
|
"minuit_bllh.errordef = 0.5 # Value for likelihood fits\n", |
|
"minuit_fit_bllh.errordef = 0.5 # Value for likelihood fit\n", |
Conversely, in the case of the example solution to LikelihoodFit_original.ipynb, that's not the case:
|
"minuit_fit_bllh = Minuit(bllh_object_fit, tau=tau_truth, N0=Ntimes)\n", |
Initially, I was perplexed, and couldn't figure out why the BLLH and ULLH fits still worked. However, it seems the UnbinnedLH() and BinnedLH() classes redefine the errordef attribute by default,
which is incredibly useful. But also seems inconsistent and confusing.
I suggest adding a comment to the relevant files, explaining the errordef attribute. I also suggest usage of errordef to be consistent accross notebooks: either let the UnbinnedLH() and BinnedLH() classes handle it - or make the student deal with errordef explicitly in each case.
Maybe even consider illustrating what happens if you use the wrong errordef for the wrong fit, and to what degree it matters because I'm not entirely sure myself. What I gather from the documentation, is that understanding and defining errordef correctly is important for doing correct error calculation, so it seems important to get right!
In the Week 2 exercises, the iMinuit
errordefattribute is explicitly redefined as 0.5 several time in the following files,AppStat2023/Week2/FittingMethods/FittingMethods_original.ipynb
Line 399 in 5235104
AppStat2023/Week2/FittingMethods/FittingMethods_ExampleSolution.ipynb
Line 409 in 5235104
AppStat2023/Week2/LikelihoodFit/LikelihoodFit_original.ipynb
Line 625 in 5235104
Conversely, in the case of the example solution to
LikelihoodFit_original.ipynb, that's not the case:AppStat2023/Week2/LikelihoodFit/LikelihoodFit_ExampleSolution.ipynb
Line 630 in 5235104
Initially, I was perplexed, and couldn't figure out why the BLLH and ULLH fits still worked. However, it seems the
UnbinnedLH()andBinnedLH()classes redefine theerrordefattribute by default,AppStat2023/External_Functions/ExternalFunctions.py
Line 205 in 5235104
AppStat2023/External_Functions/ExternalFunctions.py
Line 273 in 5235104
which is incredibly useful. But also seems inconsistent and confusing.
I suggest adding a comment to the relevant files, explaining the
errordefattribute. I also suggest usage oferrordefto be consistent accross notebooks: either let theUnbinnedLH()andBinnedLH()classes handle it - or make the student deal witherrordefexplicitly in each case.Maybe even consider illustrating what happens if you use the wrong
errordeffor the wrong fit, and to what degree it matters because I'm not entirely sure myself. What I gather from the documentation, is that understanding and definingerrordefcorrectly is important for doing correct error calculation, so it seems important to get right!