Home | News | Documentation | Download

Printed error differs from stored error when using SumW2Error

At the end of a fit, RooFit prints a summary table with parameter values and errors. The errors printed in this table are different from the stored errors when using SumW2Error, dramatically so for binned fits.

Why do the printed and stored values differ and which is correct? Moreover, for an unweighted dataset, shouldn’t SumW2Error have no effect?

Similar considerations apply for AsymptoticError.

Reproducer follows.

EDIT:
The excessive difference for binned fits seems to disappear when BatchMode is disabled. So the differences are smaller for unbinned or non-batch fits, though they are still present.


import ROOT as r

ws = r.RooWorkspace("workspace")
x = ws.factory("x[-10, 10]")
sig = ws.factory("Gaussian::sig(x, mu[-1, 1], s[0.1, 5])")
bkg = ws.factory("Chebychev::bkg(x, {c1[0.1, -1, 1]})")
shp = ws.factory("SUM::shp(Nsig[0, 200] * sig, Nbkg[0, 200] * bkg)")
data = shp.generate(r.RooArgSet(x))
ws.Import(data)
print("with SumW2Error:")
res = shp.fitTo(
    data,
    r.RooFit.Extended(),
    r.RooFit.Save(),
    r.RooFit.SumW2Error(True),
    r.RooFit.Strategy(1),
    r.RooFit.BatchMode(True),
)
res.Print()
print("without SumW2Error:")
res = shp.fitTo(
    data,
    r.RooFit.Extended(),
    r.RooFit.Save(),
    r.RooFit.SumW2Error(False),
    r.RooFit.Strategy(1),
    r.RooFit.BatchMode(True),
)
res.Print()

Output:


RooFit v3.60 -- Developed by Wouter Verkerke and David Kirkby 
                Copyright (C) 2000-2013 NIKHEF, University of California & Stanford University
                All rights reserved, please read http://roofit.sourceforge.net/license.txt

[#1] INFO:ObjectHandling -- RooWorkspace::import(workspace) importing dataset shpData
with SumW2Error:
[#1] INFO:Minization -- createNLL: caching constraint set under name CONSTR_OF_PDF_shp_FOR_OBS_x with 0 entries
[#1] INFO:Minization -- RooMinimizer::optimizeConst: activating const optimization
 **********
 **    1 **SET PRINT           1
 **********
 **********
 **    2 **SET NOGRAD
 **********
 PARAMETER DEFINITIONS:
    NO.   NAME         VALUE      STEP SIZE      LIMITS
     1 Nbkg         1.00000e+02  2.00000e+01    0.00000e+00  2.00000e+02
     2 Nsig         1.00000e+02  2.00000e+01    0.00000e+00  2.00000e+02
     3 c1           1.00000e-01  2.00000e-01   -1.00000e+00  1.00000e+00
     4 mu           0.00000e+00  2.00000e-01   -1.00000e+00  1.00000e+00
     5 s            2.55000e+00  4.90000e-01    1.00000e-01  5.00000e+00
 **********
 **    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        2500           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
 FCN=-299.19 FROM MIGRAD    STATUS=INITIATE       16 CALLS          17 TOTAL
                     EDM= unknown      STRATEGY= 1      NO ERROR MATRIX       
  EXT PARAMETER               CURRENT GUESS       STEP         FIRST   
  NO.   NAME      VALUE            ERROR          SIZE      DERIVATIVE 
   1  Nbkg         1.00000e+02   2.00000e+01   2.01358e-01   6.00895e+00
   2  Nsig         1.00000e+02   2.00000e+01   2.01358e-01  -6.00904e+00
   3  c1           1.00000e-01   2.00000e-01   2.02430e-01  -5.01767e+00
   4  mu           0.00000e+00   2.00000e-01   2.01358e-01  -4.22636e+00
   5  s            2.55000e+00   4.90000e-01   2.01358e-01  -1.28338e+00
                               ERR DEF= 0.5
 MIGRAD MINIMIZATION HAS CONVERGED.
 MIGRAD WILL VERIFY CONVERGENCE AND ERROR MATRIX.
 COVARIANCE MATRIX CALCULATED SUCCESSFULLY
 FCN=-303.213 FROM MIGRAD    STATUS=CONVERGED     118 CALLS         119 TOTAL
                     EDM=7.49028e-05    STRATEGY= 1      ERROR MATRIX ACCURATE 
  EXT PARAMETER                                   STEP         FIRST   
  NO.   NAME      VALUE            ERROR          SIZE      DERIVATIVE 
   1  Nbkg         5.41047e+01   2.21287e+01   1.51558e-03  -6.00593e-03
   2  Nsig         1.45931e+02   2.40308e+01   1.85824e-03   2.40501e-02
   3  c1           2.09549e-01   3.36596e-01   3.51927e-03   1.96629e-02
   4  mu           4.64253e-01   3.92685e-01   4.65228e-03   1.17958e-02
   5  s            3.17954e+00   4.86056e-01   1.49199e-03  -1.38766e-02
                               ERR DEF= 0.5
 EXTERNAL ERROR MATRIX.    NDIM=  25    NPAR=  5    ERR DEF=0.5
  5.002e+02 -4.460e+02 -6.546e-01  3.102e-01 -8.592e+00 
 -4.460e+02  5.921e+02  6.549e-01 -3.104e-01  8.594e+00 
 -6.546e-01  6.549e-01  1.181e-01 -7.654e-02  2.481e-02 
  3.102e-01 -3.104e-01 -7.654e-02  1.655e-01 -1.509e-02 
 -8.592e+00  8.594e+00  2.481e-02 -1.509e-02  2.396e-01 
 PARAMETER  CORRELATION COEFFICIENTS  
       NO.  GLOBAL      1      2      3      4      5
        1  0.86612   1.000 -0.820 -0.085  0.034 -0.785
        2  0.82931  -0.820  1.000  0.078 -0.031  0.721
        3  0.55844  -0.085  0.078  1.000 -0.547  0.147
        4  0.54770   0.034 -0.031 -0.547  1.000 -0.076
        5  0.80050  -0.785  0.721  0.147 -0.076  1.000
 **********
 **    7 **SET ERR         0.5
 **********
 **********
 **    8 **SET PRINT           1
 **********
 **********
 **    9 **HESSE        2500
 **********
 COVARIANCE MATRIX CALCULATED SUCCESSFULLY
 FCN=-303.213 FROM HESSE     STATUS=OK             31 CALLS         150 TOTAL
                     EDM=7.51899e-05    STRATEGY= 1      ERROR MATRIX ACCURATE 
  EXT PARAMETER                                INTERNAL      INTERNAL  
  NO.   NAME      VALUE            ERROR       STEP SIZE       VALUE   
   1  Nbkg         5.41047e+01   2.22703e+01   3.03115e-04  -4.76816e-01
   2  Nsig         1.45931e+02   2.41666e+01   3.71647e-04   4.77220e-01
   3  c1           2.09549e-01   3.36686e-01   7.03855e-04   2.11114e-01
   4  mu           4.64253e-01   3.92862e-01   9.30455e-04   4.82791e-01
   5  s            3.17954e+00   4.88848e-01   2.98397e-04   2.59870e-01
                               ERR DEF= 0.5
 EXTERNAL ERROR MATRIX.    NDIM=  25    NPAR=  5    ERR DEF=0.5
  5.067e+02 -4.528e+02 -6.466e-01  3.055e-01 -8.730e+00 
 -4.528e+02  5.990e+02  6.469e-01 -3.056e-01  8.734e+00 
 -6.466e-01  6.469e-01  1.181e-01 -7.668e-02  2.467e-02 
  3.055e-01 -3.056e-01 -7.668e-02  1.657e-01 -1.509e-02 
 -8.730e+00  8.734e+00  2.467e-02 -1.509e-02  2.424e-01 
 PARAMETER  CORRELATION COEFFICIENTS  
       NO.  GLOBAL      1      2      3      4      5
        1  0.86799   1.000 -0.822 -0.084  0.033 -0.788
        2  0.83147  -0.822  1.000  0.077 -0.031  0.725
        3  0.55878  -0.084  0.077  1.000 -0.548  0.146
        4  0.54833   0.033 -0.031 -0.548  1.000 -0.075
        5  0.80309  -0.788  0.725  0.146 -0.075  1.000
[#1] INFO:Fitting -- RooAbsPdf::fitTo(shp) Calculating sum-of-weights-squared correction matrix for covariance matrix
 **********
 **   10 **SET ERR         0.5
 **********
 **********
 **   11 **SET PRINT           1
 **********
 **********
 **   12 **HESSE        2500
 **********
 COVARIANCE MATRIX CALCULATED SUCCESSFULLY
 FCN=-303.213 FROM HESSE     STATUS=OK             31 CALLS         181 TOTAL
                     EDM=7.52462e-05    STRATEGY= 1      ERROR MATRIX ACCURATE 
  EXT PARAMETER                                INTERNAL      INTERNAL  
  NO.   NAME      VALUE            ERROR       STEP SIZE       VALUE   
   1  Nbkg         5.41047e+01   2.22992e+01   6.06231e-05  -4.76816e-01
   2  Nsig         1.45931e+02   2.41943e+01   7.43294e-05   4.77220e-01
   3  c1           2.09549e-01   3.36704e-01   1.40771e-04   2.11114e-01
   4  mu           4.64253e-01   3.92897e-01   1.86091e-04   4.82791e-01
   5  s            3.17954e+00   4.89416e-01   5.96794e-05   2.59870e-01
                               ERR DEF= 0.5
 EXTERNAL ERROR MATRIX.    NDIM=  25    NPAR=  5    ERR DEF=0.5
  5.081e+02 -4.542e+02 -6.450e-01  3.045e-01 -8.758e+00 
 -4.542e+02  6.004e+02  6.453e-01 -3.047e-01  8.762e+00 
 -6.450e-01  6.453e-01  1.182e-01 -7.671e-02  2.464e-02 
  3.045e-01 -3.047e-01 -7.671e-02  1.657e-01 -1.509e-02 
 -8.758e+00  8.762e+00  2.464e-02 -1.509e-02  2.430e-01 
 PARAMETER  CORRELATION COEFFICIENTS  
       NO.  GLOBAL      1      2      3      4      5
        1  0.86836   1.000 -0.822 -0.083  0.033 -0.788
        2  0.83191  -0.822  1.000  0.077 -0.031  0.725
        3  0.55885  -0.083  0.077  1.000 -0.548  0.145
        4  0.54845   0.033 -0.031 -0.548  1.000 -0.075
        5  0.80361  -0.788  0.725  0.145 -0.075  1.000
[#1] INFO:Minization -- RooMinimizer::optimizeConst: deactivating const optimization

  RooFitResult: minimized FCN value: -303.213, estimated distance to minimum: 7.52462e-05
                covariance matrix quality: Full, accurate covariance matrix
                Status : MINIMIZE=0 HESSE=0 HESSE=0 

    Floating Parameter    FinalValue +/-  Error   
  --------------------  --------------------------
                  Nbkg    5.4105e+01 +/-  2.25e+01
                  Nsig    1.4593e+02 +/-  2.44e+01
                    c1    2.0955e-01 +/-  3.44e-01
                    mu    4.6425e-01 +/-  4.07e-01
                     s    3.1795e+00 +/-  4.92e-01

without SumW2Error:
[#1] INFO:Minization -- createNLL picked up cached constraints from workspace with 0 entries
[#1] INFO:Minization -- RooMinimizer::optimizeConst: activating const optimization
 **********
 **   13 **SET PRINT           1
 **********
 **********
 **   14 **SET NOGRAD
 **********
 PARAMETER DEFINITIONS:
    NO.   NAME         VALUE      STEP SIZE      LIMITS
     1 Nbkg         5.41047e+01  2.24807e+01    0.00000e+00  2.00000e+02
     2 Nsig         1.45931e+02  2.44464e+01    0.00000e+00  2.00000e+02
     3 c1           2.09549e-01  3.43702e-01   -1.00000e+00  1.00000e+00
     4 mu           4.64253e-01  4.06999e-01   -1.00000e+00  1.00000e+00
     5 s            3.17954e+00  4.91809e-01    1.00000e-01  5.00000e+00
 **********
 **   15 **SET ERR         0.5
 **********
 **********
 **   16 **SET PRINT           1
 **********
 **********
 **   17 **SET STR           1
 **********
 NOW USING STRATEGY  1: TRY TO BALANCE SPEED AGAINST RELIABILITY
 **********
 **   18 **MIGRAD        2500           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
 FCN=-303.213 FROM MIGRAD    STATUS=INITIATE       18 CALLS          19 TOTAL
                     EDM= unknown      STRATEGY= 1      NO ERROR MATRIX       
  EXT PARAMETER               CURRENT GUESS       STEP         FIRST   
  NO.   NAME      VALUE            ERROR          SIZE      DERIVATIVE 
   1  Nbkg         5.41047e+01   2.24807e+01   2.58281e-01  -6.01700e-03
   2  Nsig         1.45931e+02   2.44464e+01   2.82082e-01   2.39913e-02
   3  c1           2.09549e-01   3.43702e-01   3.60410e-01   1.96540e-02
   4  mu           4.64253e-01   4.06999e-01   5.00231e-01   1.17591e-02
   5  s            3.17954e+00   4.91809e-01   2.09576e-01  -1.39610e-02
                               ERR DEF= 0.5
 MIGRAD MINIMIZATION HAS CONVERGED.
 MIGRAD WILL VERIFY CONVERGENCE AND ERROR MATRIX.
 COVARIANCE MATRIX CALCULATED SUCCESSFULLY
 FCN=-303.213 FROM MIGRAD    STATUS=CONVERGED      61 CALLS          62 TOTAL
                     EDM=2.58614e-05    STRATEGY= 1      ERROR MATRIX ACCURATE 
  EXT PARAMETER                                   STEP         FIRST   
  NO.   NAME      VALUE            ERROR          SIZE      DERIVATIVE 
   1  Nbkg         5.41106e+01   2.21198e+01   1.51410e-03  -8.71965e-03
   2  Nsig         1.45896e+02   2.40153e+01   1.84218e-03   7.53948e-03
   3  c1           2.08415e-01   3.36463e-01   3.50827e-03  -3.73930e-04
   4  mu           4.63185e-01   3.92460e-01   4.62498e-03  -1.91327e-03
   5  s            3.17989e+00   4.85880e-01   1.49120e-03   5.42675e-03
                               ERR DEF= 0.5
 EXTERNAL ERROR MATRIX.    NDIM=  25    NPAR=  5    ERR DEF=0.5
  4.997e+02 -4.455e+02 -6.342e-01  2.976e-01 -8.582e+00 
 -4.455e+02  5.914e+02  6.342e-01 -2.977e-01  8.581e+00 
 -6.342e-01  6.342e-01  1.180e-01 -7.641e-02  2.438e-02 
  2.976e-01 -2.977e-01 -7.641e-02  1.653e-01 -1.486e-02 
 -8.582e+00  8.581e+00  2.438e-02 -1.486e-02  2.395e-01 
 PARAMETER  CORRELATION COEFFICIENTS  
       NO.  GLOBAL      1      2      3      4      5
        1  0.86598   1.000 -0.819 -0.083  0.033 -0.785
        2  0.82916  -0.819  1.000  0.076 -0.030  0.721
        3  0.55778  -0.083  0.076  1.000 -0.547  0.145
        4  0.54737   0.033 -0.030 -0.547  1.000 -0.075
        5  0.80018  -0.785  0.721  0.145 -0.075  1.000
 **********
 **   19 **SET ERR         0.5
 **********
 **********
 **   20 **SET PRINT           1
 **********
 **********
 **   21 **HESSE        2500
 **********
 COVARIANCE MATRIX CALCULATED SUCCESSFULLY
 FCN=-303.213 FROM HESSE     STATUS=OK             31 CALLS          93 TOTAL
                     EDM=2.62244e-05    STRATEGY= 1      ERROR MATRIX ACCURATE 
  EXT PARAMETER                                INTERNAL      INTERNAL  
  NO.   NAME      VALUE            ERROR       STEP SIZE       VALUE   
   1  Nbkg         5.41106e+01   2.22608e+01   3.02820e-04  -4.76750e-01
   2  Nsig         1.45896e+02   2.41505e+01   3.68436e-04   4.76830e-01
   3  c1           2.08415e-01   3.36552e-01   7.01654e-04   2.09954e-01
   4  mu           4.63185e-01   3.92635e-01   9.24996e-04   4.81586e-01
   5  s            3.17989e+00   4.88661e-01   2.98240e-04   2.60018e-01
                               ERR DEF= 0.5
 EXTERNAL ERROR MATRIX.    NDIM=  25    NPAR=  5    ERR DEF=0.5
  5.063e+02 -4.522e+02 -6.259e-01  2.927e-01 -8.719e+00 
 -4.522e+02  5.982e+02  6.260e-01 -2.927e-01  8.721e+00 
 -6.259e-01  6.260e-01  1.180e-01 -7.655e-02  2.423e-02 
  2.927e-01 -2.927e-01 -7.655e-02  1.655e-01 -1.486e-02 
 -8.719e+00  8.721e+00  2.423e-02 -1.486e-02  2.423e-01 
 PARAMETER  CORRELATION COEFFICIENTS  
       NO.  GLOBAL      1      2      3      4      5
        1  0.86784   1.000 -0.822 -0.081  0.032 -0.787
        2  0.83132  -0.822  1.000  0.075 -0.029  0.724
        3  0.55812  -0.081  0.075  1.000 -0.548  0.143
        4  0.54799   0.032 -0.029 -0.548  1.000 -0.074
        5  0.80277  -0.787  0.724  0.143 -0.074  1.000
[#1] INFO:Minization -- RooMinimizer::optimizeConst: deactivating const optimization

  RooFitResult: minimized FCN value: -303.213, estimated distance to minimum: 2.62244e-05
                covariance matrix quality: Full, accurate covariance matrix
                Status : MINIMIZE=0 HESSE=0 

    Floating Parameter    FinalValue +/-  Error   
  --------------------  --------------------------
                  Nbkg    5.4111e+01 +/-  2.23e+01
                  Nsig    1.4590e+02 +/-  2.42e+01
                    c1    2.0842e-01 +/-  3.37e-01
                    mu    4.6319e-01 +/-  3.93e-01
                     s    3.1799e+00 +/-  4.89e-01

Notice that with SumW2Error the printed error on Nbkg is 2.23e+01 while that stored in the result is 2.25e+01. Without SumW2Error, they are both 2.23e+01. A similar effect can be seen with AsymptoticError(True).

The differences are much worse with binned data:

datahist = r.RooDataHist("datahist", "datahist", data.get(), data)
res = shp.fitTo(
    datahist,
    r.RooFit.Extended(),
    r.RooFit.Save(),
    r.RooFit.SumW2Error(True),
    r.RooFit.Strategy(1),
    r.RooFit.BatchMode(True),
)
res.Print()

Output:

[#1] INFO:Minization -- createNLL picked up cached constraints from workspace with 0 entries
[#1] INFO:Minization -- RooMinimizer::optimizeConst: activating const optimization
 **********
 **   73 **SET PRINT           1
 **********
 **********
 **   74 **SET NOGRAD
 **********
 PARAMETER DEFINITIONS:
    NO.   NAME         VALUE      STEP SIZE      LIMITS
     1 Nbkg         5.41849e+01  2.31459e+01    0.00000e+00  2.00000e+02
     2 Nsig         1.45814e+02  2.31472e+01    0.00000e+00  2.00000e+02
     3 c1           2.08299e-01  3.48104e-01   -1.00000e+00  1.00000e+00
     4 mu           4.63687e-01  4.11892e-01   -1.00000e+00  1.00000e+00
     5 s            3.17833e+00  5.28331e-01    1.00000e-01  5.00000e+00
 **********
 **   75 **SET ERR         0.5
 **********
 **********
 **   76 **SET PRINT           1
 **********
 **********
 **   77 **SET STR           1
 **********
 NOW USING STRATEGY  1: TRY TO BALANCE SPEED AGAINST RELIABILITY
 **********
 **   78 **MIGRAD        2500           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
 FCN=-303.383 FROM MIGRAD    STATUS=INITIATE       18 CALLS          19 TOTAL
                     EDM= unknown      STRATEGY= 1      NO ERROR MATRIX       
  EXT PARAMETER               CURRENT GUESS       STEP         FIRST   
  NO.   NAME      VALUE            ERROR          SIZE      DERIVATIVE 
   1  Nbkg         5.41849e+01   2.31459e+01   2.66135e-01   9.55564e-02
   2  Nsig         1.45814e+02   2.31472e+01   2.66149e-01  -3.64247e-02
   3  c1           2.08299e-01   3.48104e-01   3.65158e-01   4.70599e-02
   4  mu           4.63687e-01   4.11892e-01   5.07407e-01   3.40515e-02
   5  s            3.17833e+00   5.28331e-01   2.25426e-01   1.83695e-01
                               ERR DEF= 0.5
 MIGRAD MINIMIZATION HAS CONVERGED.
 MIGRAD WILL VERIFY CONVERGENCE AND ERROR MATRIX.
 COVARIANCE MATRIX CALCULATED SUCCESSFULLY
 FCN=-303.384 FROM MIGRAD    STATUS=CONVERGED      61 CALLS          62 TOTAL
                     EDM=2.87246e-05    STRATEGY= 1      ERROR MATRIX ACCURATE 
  EXT PARAMETER                                   STEP         FIRST   
  NO.   NAME      VALUE            ERROR          SIZE      DERIVATIVE 
   1  Nbkg         5.40861e+01   2.19506e+01   1.51525e-03  -1.95993e-02
   2  Nsig         1.45869e+02   2.38509e+01   1.83954e-03  -1.99599e-02
   3  c1           2.05423e-01   3.36385e-01   3.51059e-03   1.31456e-03
   4  mu           4.60414e-01   3.91325e-01   4.62417e-03  -6.22323e-03
   5  s            3.17342e+00   4.81816e-01   1.49271e-03   1.34641e-02
                               ERR DEF= 0.5
 EXTERNAL ERROR MATRIX.    NDIM=  25    NPAR=  5    ERR DEF=0.5
  4.920e+02 -4.375e+02 -7.076e-01  4.250e-01 -8.414e+00 
 -4.375e+02  5.831e+02  7.073e-01 -4.248e-01  8.409e+00 
 -7.076e-01  7.073e-01  1.179e-01 -7.607e-02  2.596e-02 
  4.250e-01 -4.248e-01 -7.607e-02  1.642e-01 -1.768e-02 
 -8.414e+00  8.409e+00  2.596e-02 -1.768e-02  2.354e-01 
 PARAMETER  CORRELATION COEFFICIENTS  
       NO.  GLOBAL      1      2      3      4      5
        1  0.86398   1.000 -0.817 -0.093  0.047 -0.782
        2  0.82672  -0.817  1.000  0.085 -0.043  0.718
        3  0.55772  -0.093  0.085  1.000 -0.547  0.156
        4  0.54680   0.047 -0.043 -0.547  1.000 -0.090
        5  0.79798  -0.782  0.718  0.156 -0.090  1.000
 **********
 **   79 **SET ERR         0.5
 **********
 **********
 **   80 **SET PRINT           1
 **********
 **********
 **   81 **HESSE        2500
 **********
 COVARIANCE MATRIX CALCULATED SUCCESSFULLY
 FCN=-303.384 FROM HESSE     STATUS=OK             31 CALLS          93 TOTAL
                     EDM=2.88088e-05    STRATEGY= 1      ERROR MATRIX ACCURATE 
  EXT PARAMETER                                INTERNAL      INTERNAL  
  NO.   NAME      VALUE            ERROR       STEP SIZE       VALUE   
   1  Nbkg         5.40861e+01   2.20876e+01   3.03051e-04  -4.77026e-01
   2  Nsig         1.45869e+02   2.39821e+01   3.67907e-04   4.76523e-01
   3  c1           2.05423e-01   3.36470e-01   7.02118e-04   2.06896e-01
   4  mu           4.60414e-01   3.91498e-01   9.24834e-04   4.78461e-01
   5  s            3.17342e+00   4.84517e-01   2.98543e-04   2.57285e-01
                               ERR DEF= 0.5
 EXTERNAL ERROR MATRIX.    NDIM=  25    NPAR=  5    ERR DEF=0.5
  4.983e+02 -4.440e+02 -7.011e-01  4.227e-01 -8.546e+00 
 -4.440e+02  5.897e+02  7.009e-01 -4.225e-01  8.543e+00 
 -7.011e-01  7.009e-01  1.180e-01 -7.621e-02  2.585e-02 
  4.227e-01 -4.225e-01 -7.621e-02  1.644e-01 -1.773e-02 
 -8.546e+00  8.543e+00  2.585e-02 -1.773e-02  2.381e-01 
 PARAMETER  CORRELATION COEFFICIENTS  
       NO.  GLOBAL      1      2      3      4      5
        1  0.86583   1.000 -0.819 -0.091  0.047 -0.785
        2  0.82886  -0.819  1.000  0.084 -0.043  0.721
        3  0.55805  -0.091  0.084  1.000 -0.547  0.154
        4  0.54741   0.047 -0.043 -0.547  1.000 -0.090
        5  0.80054  -0.785  0.721  0.154 -0.090  1.000
[#1] INFO:Fitting -- RooAbsPdf::fitTo(shp) Calculating sum-of-weights-squared correction matrix for covariance matrix
 **********
 **   82 **SET ERR         0.5
 **********
 **********
 **   83 **SET PRINT           1
 **********
 **********
 **   84 **HESSE        2500
 **********
 COVARIANCE MATRIX CALCULATED SUCCESSFULLY
 FCN=1171.67 FROM HESSE     STATUS=OK             39 CALLS         132 TOTAL
                     EDM=268.711    STRATEGY= 1      ERROR MATRIX ACCURATE 
  EXT PARAMETER                                INTERNAL      INTERNAL  
  NO.   NAME      VALUE            ERROR       STEP SIZE       VALUE   
   1  Nbkg         5.40861e+01   1.18686e+01   6.06101e-05  -4.77026e-01
   2  Nsig         1.45869e+02   9.38736e+00   7.50531e-03   4.76523e-01
   3  c1           2.05423e-01   2.47582e-01   1.43232e-02   2.06896e-01
   4  mu           4.60414e-01   1.57589e-01   1.88666e-02   4.78461e-01
   5  s            3.17342e+00   2.42483e-01   6.09027e-03   2.57285e-01
                               ERR DEF= 0.5
 EXTERNAL ERROR MATRIX.    NDIM=  25    NPAR=  5    ERR DEF=0.5
  1.417e+02  1.961e+00  3.799e-01 -1.359e-01 -7.537e-01 
  1.961e+00  8.845e+01 -8.241e-02  2.952e-02  1.651e-01 
  3.799e-01 -8.241e-02  6.265e-02 -1.659e-02  5.003e-03 
 -1.359e-01  2.952e-02 -1.659e-02  2.510e-02 -4.439e-04 
 -7.537e-01  1.651e-01  5.003e-03 -4.439e-04  5.900e-02 
 PARAMETER  CORRELATION COEFFICIENTS  
       NO.  GLOBAL      1      2      3      4      5
        1  0.30377   1.000  0.018  0.128 -0.072 -0.261
        2  0.09442   0.018  1.000 -0.035  0.020  0.072
        3  0.44418   0.128 -0.035  1.000 -0.418  0.082
        4  0.41915  -0.072  0.020 -0.418  1.000 -0.012
        5  0.29742  -0.261  0.072  0.082 -0.012  1.000
[#1] INFO:Minization -- RooMinimizer::optimizeConst: deactivating const optimization

  RooFitResult: minimized FCN value: 1171.67, estimated distance to minimum: 268.711
                covariance matrix quality: Full, accurate covariance matrix
                Status : MINIMIZE=0 HESSE=0 HESSE=0 

    Floating Parameter    FinalValue +/-  Error   
  --------------------  --------------------------
                  Nbkg    5.4086e+01 +/-  6.76e+01
                  Nsig    1.4587e+02 +/-  7.70e+01
                    c1    2.0542e-01 +/-  5.88e-01
                    mu    4.6041e-01 +/-  1.05e+00
                     s    3.1734e+00 +/-  1.40e+00

The printed error is 1.19e+01 and the stored error is 6.76e+01.

Maybe @moneta or @jonas can have an explanation

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

Hi,

Sorry for the late reply.
It is normal that when using the weighted fits with SumW2Error or Asymptotic the error printed by TMinuit are different. The ones of TMinuit are the row un-corrected errors, while the ones in TFitResult are corrected using a procedure shown in the RooAbsPdf::fitTo documentation.

Cheers

Lorenzo