fitTo AsymptoticError option for fitting weighted dataset

Dear Roofitters,

I am performing a fit to a weighted dataset (the weight distribution is quite broad and it has <1% negative weights) and then trying to get a correct estimation of the parameters uncertainties. For that i used the AsymptoticError(true) option of fitTo. The fit converges without issues, but when it tries to calculate the corrected covariance matrix I get evaluation errors telling me the pdf is less than 0:

[#1] INFO:Fitting – RooAbsPdf::fitTo(cmodel_INC) Calculating covariance matrix according to the asymptotically correct approach. If you find this method useful please consider citing [1911.01303] Parameter uncertainties in weighted unbinned maximum likelihood fits.
[#0] ERROR:Eval – RooAbsReal::logEvalError(model_INC) evaluation error,
origin : RooAddPdf::model_INC[ norm_h_Phi_SR_Mix_KDE_INC * pdf_h_Phi_SR_Mix_KDE_INC + norm_h_Phi_SR_Signal_H_INC * pdf_h_Phi_SR_Signal_H_INC ]
message : p.d.f value is less than zero (-0.016755), forcing value to zero
server values: !refCoefNorm=(), !refCoefNorm=(), !pdfs=(pdf_h_Phi_SR_Mix_KDE_INC = 0.00822085/1,pdf_h_Phi_SR_Signal_H_INC = 0.191187/1), !coefficients=(norm_h_Phi_SR_Mix_KDE_INC = 2760.21,norm_h_Phi_SR_Signal_H_INC = -331.522)
[#0] ERROR:Eval – RooAbsReal::logEvalError(model_INC) evaluation error,
origin : RooAddPdf::model_INC[ norm_h_Phi_SR_Mix_KDE_INC * pdf_h_Phi_SR_Mix_KDE_INC + norm_h_Phi_SR_Signal_H_INC * pdf_h_Phi_SR_Signal_H_INC ]
message : p.d.f value is less than zero (-0.006503), forcing value to zero
server values: !refCoefNorm=(), !refCoefNorm=(), !pdfs=(pdf_h_Phi_SR_Mix_KDE_INC = 0.00802282/1,pdf_h_Phi_SR_Signal_H_INC = 0.114438/1), !coefficients=(norm_h_Phi_SR_Mix_KDE_INC = 2760.21,norm_h_Phi_SR_Signal_H_INC = -331.522)
[#0] ERROR:Eval – RooAbsReal::logEvalError(model_INC) evaluation error,
origin : RooAddPdf::model_INC[ norm_h_Phi_SR_Mix_KDE_INC * pdf_h_Phi_SR_Mix_KDE_INC + norm_h_Phi_SR_Signal_H_INC * pdf_h_Phi_SR_Signal_H_INC ]
message : p.d.f value is less than zero (-0.002421), forcing value to zero
server values: !refCoefNorm=(), !refCoefNorm=(), !pdfs=(pdf_h_Phi_SR_Mix_KDE_INC = 0.00798658/1,pdf_h_Phi_SR_Signal_H_INC = 0.0842332/1), !coefficients=(norm_h_Phi_SR_Mix_KDE_INC = 2760.21,norm_h_Phi_SR_Signal_H_INC = -331.522)
(etc)

I am using a S+B model and in this case the fit result makes S negative, so the pdf can be -ve, but not really in the range I’ve restricted it to.
I find the errors strange given that if indeed i had negative values of the pdf wouldn’t the fit have issues as well? I’ve evaluated the pdf for different values of my observable has a check (after fitting) and only got positive values. Has anyone seen this problem before with the AsymptoticError option?

Thank you in advance.
Cheers,
Júlia

Hi @juliasilva ,
and welcome to the ROOT forum!
Let’s ping our RooFit experts @moneta and @jonas :slight_smile:

Cheers,
Enrico

Hi,
It is possible you are getting this errors when computing the gradients needed for the AsymptoticError. There are some issues in case the parameters solutions are closed to the border of the physical regions.
We have already a JIRA item opened for this, https://sft.its.cern.ch/jira/browse/ROOT-10866

Lorenzo

Hi! Thanks for the reply!
So that means I can’t trust my final RooFitResult, right?

Cheers,
Júlia

Yes, the error, probably the central value is correct. You can try to compute errors using also the Sumw2 option, which provides another approximation.

Cheers

Lorenzo

Thanks for update and quick reply. I’ll be sure to keep an eye on this thread.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.