Hello Experts,
I am using Roofit to fit my data where I am using tow Gaussian + Polynomial. I notice if I limit the Polynomial function from -100 to 100 I get error as “Minimized function has error status”. But at the end the fitting looks fine. I want to make sure if the fitting that end up with status=OK means it is correct. I am also wondering if there is away to avoid these errors.
Bellow a part of the output of my fitting to see what I mean.
[#0] WARNING:InputArguments -- The parameter 'gaus_sigma' with range [-1e+30, 1e+30] of the RooGaussian 'gaus' exceeds the safe range of (0, inf). Advise to limit its range.
[#0] WARNING:InputArguments -- The parameter 'gaus_sigma2' with range [-1e+30, 1e+30] of the RooGaussian 'gaus2' exceeds the safe range of (0, inf). Advise to limit its range.
[#1] INFO:Minimization -- p.d.f. provides expected number of events, including extended term in likelihood.
[#1] INFO:Minimization -- RooAbsMinimizerFcn::setOptimizeConst: activating const optimization
[#1] INFO:Minimization -- The following expressions have been identified as constant and will be precalculated and cached: (gaus,gaus2)
[#1] INFO:Minimization -- The following expressions will be evaluated in cache-and-track mode: (poly)
**********
** 1 **SET PRINT 1
**********
**********
** 2 **SET NOGRAD
**********
PARAMETER DEFINITIONS:
NO. NAME VALUE STEP SIZE LIMITS
1 BG_gaus 5.00000e+05 2.50000e+05 0.00000e+00 2.00000e+07
MINUIT WARNING IN PARAM DEF
============== LIMITS ON PARAM1 TOO FAR APART.
PARAMETER DEFINITIONS:
NO. NAME VALUE STEP SIZE LIMITS
2 BG_poly 5.00000e+05 2.50000e+05 0.00000e+00 2.00000e+07
MINUIT WARNING IN PARAM DEF
============== LIMITS ON PARAM2 TOO FAR APART.
PARAMETER DEFINITIONS:
NO. NAME VALUE STEP SIZE LIMITS
3 Sig_gaus 5.00000e+05 2.50000e+05 0.00000e+00 2.00000e+07
MINUIT WARNING IN PARAM DEF
============== LIMITS ON PARAM3 TOO FAR APART.
PARAMETER DEFINITIONS:
NO. NAME VALUE STEP SIZE LIMITS
4 p1 1.00000e+00 2.00000e+01 -1.00000e+02 1.00000e+02
5 p2 1.00000e+00 2.00000e+01 -1.00000e+02 1.00000e+02
6 p3 1.00000e+00 2.00000e+01 -1.00000e+02 1.00000e+02
7 p4 1.00000e+00 2.00000e+01 -1.00000e+02 1.00000e+02
8 p5 1.00000e+00 2.00000e+01 -1.00000e+02 1.00000e+02
**********
** 3 **SET ERR 0.5
**********
**********
** 4 **SET PRINT 1
**********
**********
** 5 **SET STR 1
**********
NOW USING STRATEGY 1: TRY TO BALANCE SPEED AGAINST RELIABILITY
**********
** 6 **MIGRAD 4000 1
**********
FIRST CALL TO USER FUNCTION AT NEW START POINT, WITH IFLAG=4.
START MIGRAD MINIMIZATION. STRATEGY 1. CONVERGENCE WHEN EDM .LT. 1.00e-03
RooAbsMinimizerFcn: Minimized function has error status.
Returning maximum FCN so far (-517208) to force MIGRAD to back out of this region. Error log follows.
Parameter values: BG_gaus=500000 BG_poly=500000 Sig_gaus=500000 p1=-6.73355 p2=1 p3=1 p4=1 p5=1
RooAddPdf::pdf_model[ Sig_gaus * gaus + BG_gaus * gaus2 + BG_poly * poly ]
p.d.f value is Not-a-Number @ !refCoefNorm=(), !pdfs=(gaus = 1.91678e-27/0.12117,gaus2 = 2.66622e-17/0.236865,poly = -1.45883/0.986367), !coefficients=(Sig_gaus = 500000,BG_gaus = 500000,BG_poly = 500000)
getLogVal() top-level p.d.f evaluates to NaN @ !refCoefNorm=(), !pdfs=(gaus = 1.91678e-27/0.12117,gaus2 = 2.66622e-17/0.236865,poly = -1.45883/0.986367), !coefficients=(Sig_gaus = 500000,BG_gaus = 500000,BG_poly = 500000)
p.d.f value is Not-a-Number @ !refCoefNorm=(), !pdfs=(gaus = 1.86134e-26/0.12117,gaus2 = 6.68296e-17/0.236865,poly = -1.50875/0.986367), !coefficients=(Sig_gaus = 500000,BG_gaus = 500000,BG_poly = 500000)
getLogVal() top-level p.d.f evaluates to NaN @ !refCoefNorm=(), !pdfs=(gaus = 1.86134e-26/0.12117,gaus2 = 6.68296e-17/0.236865,poly = -1.50875/0.986367), !coefficients=(Sig_gaus = 500000,BG_gaus = 500000,BG_poly = 500000)
p.d.f value is Not-a-Number @ !refCoefNorm=(), !pdfs=(gaus = 1.54376e-24/0.12117,gaus2 = 4.05999e-16/0.236865,poly = -1.60617/0.986367), !coefficients=(Sig_gaus = 500000,BG_gaus = 500000,BG_poly = 500000)
getLogVal() top-level p.d.f evaluates to NaN @ !refCoefNorm=(), !pdfs=(gaus = 1.54376e-24/0.12117,gaus2 = 4.05999e-16/0.236865,poly = -1.60617/0.986367), !coefficients=(Sig_gaus = 500000,BG_gaus = 500000,BG_poly = 500000)
p.d.f value is Not-a-Number @ !refCoefNorm=(), !pdfs=(gaus = 1.31849e-23/0.12117,gaus2 = 9.84029e-16/0.236865,poly = -1.65362/0.986367), !coefficients=(Sig_gaus = 500000,BG_gaus = 500000,BG_poly = 500000)
getLogVal() top-level p.d.f evaluates to NaN @ !refCoefNorm=(), !pdfs=(gaus = 1.31849e-23/0.12117,gaus2 = 9.84029e-16/0.236865,poly = -1.65362/0.986367), !coefficients=(Sig_gaus = 500000,BG_gaus = 500000,BG_poly = 500000)
p.d.f value is Not-a-Number @ !refCoefNorm=(), !pdfs=(gaus = 1.07892e-22/0.12117,gaus2 = 2.35846e-15/0.236865,poly = -1.70018/0.986367), !coefficients=(Sig_gaus = 500000,BG_gaus = 500000,BG_poly = 500000)
getLogVal() top-level p.d.f evaluates to NaN @ !refCoefNorm=(), !pdfs=(gaus = 1.07892e-22/0.12117,gaus2 = 2.35846e-15/0.236865,poly = -1.70018/0.986367), !coefficients=(Sig_gaus = 500000,BG_gaus = 500000,BG_poly = 500000)
p.d.f value is Not-a-Number @ !refCoefNorm=(), !pdfs=(gaus = 8.45899e-22/0.12117,gaus2 = 5.58966e-15/0.236865,poly = -1.74584/0.986367), !coefficients=(Sig_gaus = 500000,BG_gaus = 500000,BG_poly = 500000)
getLogVal() top-level p.d.f evaluates to NaN @ !refCoefNorm=(), !pdfs=(gaus = 8.45899e-22/0.12117,gaus2 = 5.58966e-15/0.236865,poly = -1.74584/0.986367), !coefficients=(Sig_gaus = 500000,BG_gaus = 500000,BG_poly = 500000)
... (remaining 138 messages suppressed)
RooPolynomial::poly[ x=x coefList=(p1,p2,p3,p4,p5) ]
p.d.f value is less than zero (-1.458831), trying to recover @ x=x=0.405, coefList=(p1 = -6.73355,p2 = 1,p3 = 1,p4 = 1,p5 = 1)
p.d.f value is less than zero (-1.508753), trying to recover @ x=x=0.415, coefList=(p1 = -6.73355,p2 = 1,p3 = 1,p4 = 1,p5 = 1)
p.d.f value is less than zero (-1.606174), trying to recover @ x=x=0.435, coefList=(p1 = -6.73355,p2 = 1,p3 = 1,p4 = 1,p5 = 1)
p.d.f value is less than zero (-1.653619), trying to recover @ x=x=0.445, coefList=(p1 = -6.73355,p2 = 1,p3 = 1,p4 = 1,p5 = 1)
p.d.f value is less than zero (-1.700183), trying to recover @ x=x=0.455, coefList=(p1 = -6.73355,p2 = 1,p3 = 1,p4 = 1,p5 = 1)
p.d.f value is less than zero (-1.745837), trying to recover @ x=x=0.465, coefList=(p1 = -6.73355,p2 = 1,p3 = 1,p4 = 1,p5 = 1)
p.d.f value is less than zero (-1.790551), trying to recover @ x=x=0.475, coefList=(p1 = -6.73355,p2 = 1,p3 = 1,p4 = 1,p5 = 1)
p.d.f value is less than zero (-1.834295), trying to recover @ x=x=0.485, coefList=(p1 = -6.73355,p2 = 1,p3 = 1,p4 = 1,p5 = 1)
p.d.f value is less than zero (-1.877038), trying to recover @ x=x=0.495, coefList=(p1 = -6.73355,p2 = 1,p3 = 1,p4 = 1,p5 = 1)
p.d.f value is less than zero (-1.918747), trying to recover @ x=x=0.505, coefList=(p1 = -6.73355,p2 = 1,p3 = 1,p4 = 1,p5 = 1)
p.d.f value is less than zero (-1.998932), trying to recover @ x=x=0.525, coefList=(p1 = -6.73355,p2 = 1,p3 = 1,p4 = 1,p5 = 1)
p.d.f value is less than zero (-2.037338), trying to recover @ x=x=0.535, coefList=(p1 = -6.73355,p2 = 1,p3 = 1,p4 = 1,p5 = 1)
... (remaining 64 messages suppressed)
RooNLLVar::nll_pdf_model_hist[ paramSet=(BG_gaus,BG_poly,Sig_gaus,gaus_mean,gaus_mean2,gaus_sigma,gaus_sigma2,p1,p2,p3,p4,p5) ]
And here what I get at the end:
function value is NAN @ paramSet=(BG_gaus = 2.57908,BG_poly = 144467,Sig_gaus = 5709.41,gaus_mean = 0.9412,gaus_mean2 = 1.2306,gaus_sigma = 0.04834,gaus_sigma2 = 0.0945,p1 = -0.943748,p2 = 0.523484,p3 = -7.23497,p4 = -18.8805,p5 = 45.9394)
MIGRAD FAILS TO FIND IMPROVEMENT
MIGRAD MINIMIZATION HAS CONVERGED.
FCN=-1.71879e+06 FROM MIGRAD STATUS=CONVERGED 1790 CALLS 1791 TOTAL
EDM=0.000269182 STRATEGY= 1 ERROR MATRIX UNCERTAINTY 3.5 per cent
EXT PARAMETER STEP FIRST
NO. NAME VALUE ERROR SIZE DERIVATIVE
1 BG_gaus 8.92208e+02 2.19996e+02 0.00000e+00 -2.13366e+01
2 BG_poly 1.42792e+05 4.48308e+02 0.00000e+00 2.48078e+01
3 Sig_gaus 6.08229e+03 1.16974e+02 0.00000e+00 -3.66262e+01
4 p1 -6.01991e-01 4.08056e-02 -0.00000e+00 -4.12706e+02
5 p2 1.00179e+00 5.03526e-02 -0.00000e+00 -2.84917e+02
6 p3 -6.76487e+00 1.15283e-01 0.00000e+00 -1.18203e+02
7 p4 -1.98399e+01 2.73289e-01 0.00000e+00 -5.66801e+01
8 p5 4.11571e+01 6.52713e-01 0.00000e+00 -4.90629e+01
ERR DEF= 0.5
EXTERNAL ERROR MATRIX. NDIM= 25 NPAR= 8 ERR DEF=0.5
4.840e+04 4.770e+04 7.373e+03 -4.827e+00 -3.831e+00 3.026e+00 2.706e+01 1.415e+01
4.770e+04 2.010e+05 1.514e+04 -7.312e+00 -5.341e+00 6.397e+00 4.386e+01 1.201e+01
7.373e+03 1.514e+04 1.368e+04 -2.324e+00 -2.151e+00 4.042e-01 1.179e+01 1.426e+01
-4.827e+00 -7.312e+00 -2.324e+00 1.665e-03 1.499e-03 -4.535e-04 -8.773e-03 -9.710e-03
-3.831e+00 -5.341e+00 -2.151e+00 1.499e-03 2.535e-03 3.504e-03 -2.183e-03 -2.952e-02
3.026e+00 6.397e+00 4.042e-01 -4.535e-04 3.504e-03 1.329e-02 2.161e-02 -6.690e-02
2.706e+01 4.386e+01 1.179e+01 -8.773e-03 -2.183e-03 2.161e-02 7.469e-02 -5.065e-02
1.415e+01 1.201e+01 1.426e+01 -9.710e-03 -2.952e-02 -6.690e-02 -5.065e-02 4.260e-01
PARAMETER CORRELATION COEFFICIENTS
NO. GLOBAL 1 2 3 4 5 6 7 8
1 0.88272 1.000 0.484 0.287 -0.538 -0.346 0.119 0.450 0.099
2 0.67279 0.484 1.000 0.289 -0.400 -0.237 0.124 0.358 0.041
3 0.52211 0.287 0.289 1.000 -0.487 -0.365 0.030 0.369 0.187
4 0.99903 -0.538 -0.400 -0.487 1.000 0.730 -0.096 -0.787 -0.365
5 0.99801 -0.346 -0.237 -0.365 0.730 1.000 0.604 -0.159 -0.898
6 0.99845 0.119 0.124 0.030 -0.096 0.604 1.000 0.686 -0.889
7 0.99879 0.450 0.358 0.369 -0.787 -0.159 0.686 1.000 -0.284
8 0.99956 0.099 0.041 0.187 -0.365 -0.898 -0.889 -0.284 1.000
**********
** 7 **SET ERR 0.5
**********
**********
** 8 **SET PRINT 1
**********
**********
** 9 **HESSE 4000
**********
COVARIANCE MATRIX CALCULATED SUCCESSFULLY
FCN=-1.71879e+06 FROM HESSE STATUS=OK 75 CALLS 1866 TOTAL
EDM=0.021725 STRATEGY= 1 ERROR MATRIX ACCURATE
EXT PARAMETER INTERNAL INTERNAL
NO. NAME VALUE ERROR STEP SIZE VALUE
1 BG_gaus 8.92208e+02 2.57865e+02 1.39644e-03 -1.58415e+00
2 BG_poly 1.42792e+05 4.65829e+02 2.05669e-04 -1.40160e+00
3 Sig_gaus 6.08229e+03 1.11095e+02 2.67661e-04 -1.60568e+00
4 p1 -6.01991e-01 5.47398e-02 2.41968e-04 -6.01994e-03
5 p2 1.00179e+00 1.05145e-01 4.15545e-04 1.00181e-02
6 p3 -6.76487e+00 1.88770e-01 6.94784e-04 -6.77004e-02
7 p4 -1.98399e+01 3.10851e-01 1.16016e-03 -1.99724e-01
8 p5 4.11571e+01 4.89434e-01 2.16050e-03 4.24177e-01
ERR DEF= 0.5
EXTERNAL ERROR MATRIX. NDIM= 25 NPAR= 8 ERR DEF=0.5
6.649e+04 6.686e+04 4.488e+03 -2.314e+00 -3.036e+00 -1.900e-01 1.255e+01 2.302e+01
6.686e+04 2.170e+05 1.055e+04 -3.102e+00 -3.860e+00 7.019e-02 1.643e+01 3.127e+01
4.488e+03 1.055e+04 1.234e+04 -9.004e-01 -9.713e-01 2.515e-01 4.486e+00 9.358e+00
-2.314e+00 -3.102e+00 -9.004e-01 2.996e-03 -2.206e-03 -2.701e-03 -2.349e-03 -6.904e-04
-3.036e+00 -3.860e+00 -9.713e-01 -2.206e-03 1.106e-02 -5.131e-03 -6.650e-03 -7.272e-03
-1.900e-01 7.019e-02 2.515e-01 -2.701e-03 -5.131e-03 3.563e-02 -1.670e-02 -2.447e-02
1.255e+01 1.643e+01 4.486e+00 -2.349e-03 -6.650e-03 -1.670e-02 9.663e-02 -6.120e-02
2.302e+01 3.127e+01 9.358e+00 -6.904e-04 -7.272e-03 -2.447e-02 -6.120e-02 2.395e-01
PARAMETER CORRELATION COEFFICIENTS
NO. GLOBAL 1 2 3 4 5 6 7 8
1 0.60004 1.000 0.557 0.157 -0.164 -0.112 -0.004 0.157 0.182
2 0.57063 0.557 1.000 0.204 -0.122 -0.079 0.001 0.113 0.137
3 0.37233 0.157 0.204 1.000 -0.148 -0.083 0.012 0.130 0.172
4 0.87253 -0.164 -0.122 -0.148 1.000 -0.383 -0.261 -0.138 -0.026
5 0.89955 -0.112 -0.079 -0.083 -0.383 1.000 -0.259 -0.203 -0.141
6 0.91392 -0.004 0.001 0.012 -0.261 -0.259 1.000 -0.285 -0.265
7 0.91461 0.157 0.113 0.130 -0.138 -0.203 -0.285 1.000 -0.402
8 0.89567 0.182 0.137 0.172 -0.026 -0.141 -0.265 -0.402 1.000
[#1] INFO:Minimization -- RooAbsMinimizerFcn::setOptimizeConst: deactivating const optimization
RooFitResult: minimized FCN value: -1.71879e+06, estimated distance to minimum: 0.021725
covariance matrix quality: Full, accurate covariance matrix
Status : MINIMIZE=0 HESSE=0
Floating Parameter FinalValue +/- Error
-------------------- --------------------------
BG_gaus 8.9221e+02 +/- 2.58e+02
BG_poly 1.4279e+05 +/- 4.66e+02
Sig_gaus 6.0823e+03 +/- 1.11e+02
p1 -6.0199e-01 +/- 5.47e-02
p2 1.0018e+00 +/- 1.05e-01
p3 -6.7649e+00 +/- 1.89e-01
p4 -1.9840e+01 +/- 3.11e-01
p5 4.1157e+01 +/- 4.89e-01
[#1] INFO:Plotting -- RooAbsPdf::plotOn(pdf_model) directly selected PDF components: (gaus)
[#1] INFO:Plotting -- RooAbsPdf::plotOn(pdf_model) indirectly selected PDF components: ()
[#1] INFO:Plotting -- RooAbsPdf::plotOn(pdf_model) directly selected PDF components: (poly)
[#1] INFO:Plotting -- RooAbsPdf::plotOn(pdf_model) indirectly selected PDF components: ()
[#1] INFO:Plotting -- RooAbsPdf::plotOn(pdf_model) directly selected PDF components: (gaus2)
[#1] INFO:Plotting -- RooAbsPdf::plotOn(pdf_model) indirectly selected PDF components: ()
Info in <TCanvas::Print>: Current canvas added to pdf file fit_expPmm23PolyP.pdf
```___
_Please read [tips for efficient and successful posting](https://root-forum.cern.ch/t/tips-for-efficient-and-successful-posting/28292) and [posting code](https://root-forum.cern.ch/t/posting-code-read-this-first/28293)_
_ROOT Version:_ Not Provided
_Platform:_ Not Provided
_Compiler:_ Not Provided
___