root icon indicating copy to clipboard operation
root copied to clipboard

[RF] Determine asymptotically correct uncertainties for extended unbinned maximum likelihood fits

Open langenbruch opened this issue 1 year ago • 10 comments

This Pull request:

Added correct treatment of extended term in asymptotically correct method for uncertainty determination in the presence of weights. This improvement will allow for extended unbinned maximum likelihood fits to use the asymptotically correct method.

Changes or fixes:

-Added extended term to asymptotically correct method to allow for weighted extended maximum likelihood fits -Usage of logarithmic PDFs for derivatives may have some numerical benefits -Fixed RooDerivative to not use the parameter range in the step size calculation in case the parameter supplied has no range. This now allows to use the method (and RooDerivative in general) for parameters that do not specify a range. -Added warning in case of binned fits. In this case a chi2 fit using the std. treatment of weights should be preferrable.

Checklist:

  • [x] tested changes locally

This PR fixes # resolves https://its.cern.ch/jira/browse/ROOT-10827 resolves https://its.cern.ch/jira/browse/ROOT-10866 related #11660 note https://github.com/root-project/root/issues/11112 can not be fixed since the resulting minuit covariance matrix is not positive definite (set PrintLevel(0) to see this). Calculations with the inverse Hessians are thus not reliable. High stats fit show the expected behaviour.

langenbruch avatar Feb 16 '24 13:02 langenbruch

Can one of the admins verify this patch?

phsft-bot avatar Feb 16 '24 13:02 phsft-bot

@phsft-bot build

lmoneta avatar Feb 16 '24 14:02 lmoneta

Starting build on ROOT-performance-centos8-multicore/soversion, ROOT-ubuntu2204/nortcxxmod, ROOT-ubuntu2004/python3, mac12arm/cxx20, windows10/default How to customize builds

phsft-bot avatar Feb 16 '24 14:02 phsft-bot

Build failed on ROOT-ubuntu2004/python3. Running on root-ubuntu-2004-1.cern.ch:/home/sftnight/build/workspace/root-pullrequests-build See console output.

Failing tests:

phsft-bot avatar Feb 16 '24 17:02 phsft-bot

Test Results

    10 files      10 suites   2d 4h 41m 26s :stopwatch:  2 637 tests  2 637 :white_check_mark: 0 :zzz: 0 :x: 24 906 runs  24 906 :white_check_mark: 0 :zzz: 0 :x:

Results for commit 7eda2244.

:recycle: This comment has been updated with latest results.

github-actions[bot] avatar Feb 17 '24 06:02 github-actions[bot]

Thank you so much for helping out, @langenbruch!

I have a few change requests. Also, is it possible to implement a unit test here? https://github.com/root-project/root/blob/master/roofit/roofitcore/test/testTestStatistics.cxx

Thanks for the review @guitargeek , I implemented the requests. Please see attached the adapted tutorial rf611_weightedfits.C to demonstrate the extended functionality, which could also replace the existing one. I would prefer to not write any additional unit tests. rf611_weightedfits.tar.gz

langenbruch avatar Feb 18 '24 14:02 langenbruch

@phsft-bot build

guitargeek avatar Mar 08 '24 17:03 guitargeek

Starting build on ROOT-performance-centos8-multicore/soversion, ROOT-ubuntu2204/nortcxxmod, ROOT-ubuntu2004/python3, mac12arm/cxx20, windows10/default How to customize builds

phsft-bot avatar Mar 08 '24 17:03 phsft-bot

Thank you very much @langenbruch for the tutorial and the PR updates! I will take it from here, integrating the tutorial and maybe writing some tests, and then I'll merge the PR.

guitargeek avatar Mar 08 '24 17:03 guitargeek