root-project / root

The official repository for ROOT: analyzing, storing and visualizing big data, scientifically
https://root.cern
Other
2.71k stars 1.29k forks source link

[RF] Global correlation coefficients after SumW2Error #12935

Open goi42 opened 1 year ago

goi42 commented 1 year ago

Is your feature request related to a problem? Please describe.

As of 6.28/00, RooFitResult::globalCorr causes a seg fault if SumW2Error was used in the fit. First reported in the forum here.

Describe the solution you'd like

RooFitResult::globalCorr should return the global correlation coefficient using the corrected error matrix. As stated in the forum, the global correlation coefficients are defined as $\rho_k^2 = 1 - [V_{kk} * (V^{-1})_{kk}]^{-1}$, so the corrected correlation coefficients could be defined as $(\rho_{corr})_k^2 = 1 - [(V_{corr})_{kk} * (V_{corr}^{-1})_{kk}]^{-1}$.

Describe alternatives you've considered

At the very least, calling RooFitResult::globalCorr should raise a sensible error instead of causing a seg fault.

Additional context

More generally, it would be nice if RooFit printed the corrected matrix instead of (or after) the uncorrected one at the end of the fit. At present, one sees a long list of parameter updates printed, but the errors and correlations in the final one printed differ from those stored in the RooFitResult.

dpiparo commented 3 weeks ago

I unfortunately spoke too soon. The issue is indeed still there.