Minuit fit problem with large statistics

Dear experts,

I am trying to develop an application with Minuit2 to perform a fit and studies of systematics impact. I am following the Minuit2 guide:

https://root.cern.ch/root/htmldoc/guides/minuit2/Minuit2.html

(especially useful has been the “complete example” in sectioon 7 to start) and the suggestions from the reference manual:

I implemented my own log-likelihood to be minimize, built from Monte Carlo signal and background tempates and simulated data.

The problem I am facing shows when I have large bin contents (of the order of 10^15, which reflects the actual real case), see OUTPUT-1 below. Sometimes this does not happen, and the fit converges, even if with a “large” edm (this of course if I set a high tolerance), see OUTPUT-2 below.
If I perform a scan of the log-lokelihood in this scenario, I see oscillation in the values and the minimum shifted w.r.t. the value found by the minimization:

Also the application of Hesse and Minos fails for such large statistics.

In case of lower bin content (order of 10^4) this is not happening anymore, and the fit seems to converge pretty well with a very low edm: see OUTPUT-3. Also, the likelihood profile in this case is very smooth and centered at the fitted minimum.

The outputs I reported are obtained with low number of paramters (2 bins histograms), but this behaviour of course shows up also in a more realistic case with about 40 parameters.

I was wandering what the problem might be. I have thought this behaviour might be related to numerical problems when dealing with very high statistics (the likelihood is very steep in such a case), but I am not sure and I don’t know how to get to a viable solution. Any help and suggestion is very much appreciated.

Thanks.

OUTPUT-1:

these are the true values for the parameters of interest (b) and nuisance parameters (c):

b0 = 0.7342
b1 = 0.99484
c0 = 0.91775
c1 = 0.65241
c2 = 1.01901
c3 = 0.8635

MnSeedGenerator: for initial parameters FCN = 1.637810634044e+14
MnSeedGenerator: Initial state:   - FCN = 1.637810634044e+14 Edm =  3.76327e+14 NCalls =     25
VariableMetric: start iterating until Edm is < 0.002
VariableMetric: Initial state   - FCN = 1.637810634044e+14 Edm =  3.76327e+14 NCalls =     25
VariableMetric: Iteration #   0 - FCN = 1.637810634044e+14 Edm =  3.76327e+14 NCalls =     25
VariableMetric: Iteration #   1 - FCN =    6406182107628 Edm =  7.80296e+12 NCalls =     51
VariableMetric: Iteration #   2 - FCN =   3111167594.954 Edm =  3.62633e+09 NCalls =     77
VariableMetric: Iteration #   3 - FCN =   2296913.142666 Edm =  2.45767e+06 NCalls =     91
VariableMetric: Iteration #   4 - FCN =   574.7596185938 Edm =      628.122 NCalls =    105
VariableMetric: Iteration #   5 - FCN =   5.127487952521 Edm =     0.099702 NCalls =    119
Info: VariableMetricBuilder: no improvement in line search
VariableMetric: Iteration #   6 - FCN =   5.127487952521 Edm =     0.099702 NCalls =    120
Info: VariableMetricBuilder: iterations finish without convergence.
Info in VariableMetricBuilder : edm = 0.117619
Info in             requested : edmval = 0.002
VariableMetric: After Hessian   - FCN =   5.127487952521 Edm =  9.46032e+07 NCalls =    172
VariableMetric: Iteration #   7 - FCN =   5.127487952521 Edm =  9.46032e+07 NCalls =    172
Info: VariableMetricBuilder: Tolerance is not sufficient, continue the minimization
Info in Current  Edm is : edm = 9.46032e+07
Info in Required Edm is : edmval = 0.002
Info: VariableMetricBuilder: no improvement in line search
VariableMetric: Iteration #   8 - FCN =   5.127487952521 Edm =  9.46032e+07 NCalls =    183
Info: VariableMetricBuilder: iterations finish without convergence.
Info in VariableMetricBuilder : edm = 9.46032e+07
Info in             requested : edmval = 0.002
Info: VariableMetricBuilder: FunctionMinimum is invalid after second try

============= OUTPUT FROM MIGRAD STEP ==============

WARNING: Minuit did not converge.

# of function calls: 172
minimum function Value: 5.127487952521
minimum edm: 94603157.51513
minimum internal state vector: LAVector parameters:
     -1.033575118145
    -0.9636756223779
    -0.9362350803619
     -1.051166285965
    -0.9099004968978
    -0.9463983612187

minimum internal covariance matrix: LASymMatrix parameters:
  1.9248376e-13  7.3153301e-16 -3.1274115e-14 -2.8368372e-14 -1.0335189e-14 -6.4726005e-14
  7.3153301e-16  1.4479222e-13 -6.8879578e-14 -5.5447371e-15 -4.2384921e-14 -9.5724264e-14
 -3.1274115e-14 -6.8879578e-14  3.7869403e-14  7.1912008e-15  2.1789236e-14  5.5859239e-14
 -2.8368372e-14 -5.5447371e-15  7.1912008e-15  5.3120358e-15  3.1133086e-15  1.3124619e-14
 -1.0335189e-14 -4.2384921e-14  2.1789236e-14  3.1133086e-15  1.3099885e-14  3.1399308e-14
 -6.4726005e-14 -9.5724264e-14  5.5859239e-14  1.3124619e-14  3.1399308e-14  8.5117062e-14


# ext. ||   Name    ||   type  ||     Value     ||  Error +/- 

   0   ||        b0 || limited ||     0.7043297765156 ||1.122601001047e-06
   1   ||        b1 || limited ||      0.893529636327 ||1.085430767767e-06
   2   ||        c0 || limited ||     0.9733406113731 ||5.768198255152e-07
   3   ||        c1 || limited ||     0.6599852717614 ||1.809553379362e-07
   4   ||        c2 || limited ||      1.052786669122 ||3.512754729318e-07
   5   ||        c3 || limited ||     0.9434238939071 ||8.527932762736e-07

WARNING: FunctionMinimum is invalid: 
         Edm is above max

OUTPUT-2:

these are the true values for the parameters of interest (b) and nuisance parameters (c):

b0 = 0.7342
b1 = 0.99484
c0 = 0.91775
c1 = 0.65241
c2 = 1.01901
c3 = 0.8635

MnSeedGenerator: for initial parameters FCN = 1.63781015453e+14
MnSeedGenerator: Initial state:   - FCN = 1.63781015453e+14 Edm =  3.76327e+14 NCalls =     25
VariableMetric: start iterating until Edm is < 0.002
VariableMetric: Initial state   - FCN = 1.63781015453e+14 Edm =  3.76327e+14 NCalls =     25
VariableMetric: Iteration #   0 - FCN = 1.63781015453e+14 Edm =  3.76327e+14 NCalls =     25
VariableMetric: Iteration #   1 - FCN =    6406181833171 Edm =  7.80296e+12 NCalls =     51
VariableMetric: Iteration #   2 - FCN =   3111159670.394 Edm =  3.62632e+09 NCalls =     77
VariableMetric: Iteration #   3 - FCN =    2296917.36799 Edm =  2.45767e+06 NCalls =     91
VariableMetric: Iteration #   4 - FCN =   574.9675030975 Edm =      628.276 NCalls =    105
VariableMetric: Iteration #   5 - FCN =   5.899223758148 Edm =     0.103659 NCalls =    119
VariableMetric: Iteration #   6 - FCN =   5.800814381795 Edm =  0.000178522 NCalls =    132

============= OUTPUT FROM MIGRAD STEP ==============

Minuit did successfully converge.
# of function calls: 132
minimum function Value: 5.800814381795
minimum edm: 0.0001785223978562
minimum internal state vector: LAVector parameters:
     -1.033575103792
    -0.9636756070173
    -0.9362350546988
     -1.051166293802
    -0.9099005000428
    -0.9463983721168

minimum internal covariance matrix: LASymMatrix parameters:
  9.5239342e-16 -1.0221237e-16 -5.3705612e-17 -4.1356337e-17 -2.3913594e-17 -9.4824832e-17
 -1.0221237e-16  2.1532393e-16 -3.2889165e-17 -2.0814827e-18 -1.9227531e-17  -4.753091e-17
 -5.3705612e-17 -3.2889165e-17  1.2385391e-16  3.8123092e-20 -6.2895675e-18 -1.5166393e-17
 -4.1356337e-17 -2.0814827e-18  3.8123092e-20  9.1763512e-16  4.2930372e-18 -1.1601514e-17
 -2.3913594e-17 -1.9227531e-17 -6.2895675e-18  4.2930372e-18  1.5459706e-16 -5.7316678e-18
 -9.4824832e-17  -4.753091e-17 -1.5166393e-17 -1.1601514e-17 -5.7316678e-18  3.6592898e-16


# ext. ||   Name    ||   type  ||     Value     ||  Error +/- 

   0   ||        b0 || limited ||     0.7043298132406 ||7.896535342278e-08
   1   ||        b1 || limited ||     0.8935296801434 ||4.185773033738e-08
   2   ||        c0 || limited ||     0.9733406874418 ||3.29876087557e-08
   3   ||        c1 || limited ||     0.6599852523035 ||7.521005568334e-08
   4   ||        c2 || limited ||      1.052786659469 ||3.816055604844e-08
   5   ||        c3 || limited ||     0.9434238620516 ||5.591571095032e-08

OUTPUT-3

these are the true values for the parameters of interest (b) and nuisance parameters (c):

b0 = 0.7342
b1 = 0.99484
c0 = 0.91775
c1 = 0.65241
c2 = 1.01901
c3 = 0.8635

MnSeedGenerator: for initial parameters FCN = 1682.211823762
MnSeedGenerator: Initial state:   - FCN =   1682.211823762 Edm =      3822.07 NCalls =     25
VariableMetric: start iterating until Edm is < 0.002
VariableMetric: Initial state   - FCN =   1682.211823762 Edm =      3822.07 NCalls =     25
VariableMetric: Iteration #   0 - FCN =   1682.211823762 Edm =      3822.07 NCalls =     25
VariableMetric: Iteration #   1 - FCN =   69.03242531743 Edm =      75.9613 NCalls =     39
VariableMetric: Iteration #   2 - FCN =   5.481917023955 Edm =    0.0527581 NCalls =     53
VariableMetric: Iteration #   3 - FCN =   5.418503885897 Edm =    0.0201209 NCalls =     67
VariableMetric: Iteration #   4 - FCN =   4.700495966253 Edm =     0.104642 NCalls =     84
VariableMetric: Iteration #   5 - FCN =   4.558448766166 Edm =    0.0017108 NCalls =     98
VariableMetric: Iteration #   6 - FCN =   4.556029051722 Edm =  0.000684201 NCalls =    112
VariableMetric: After Hessian   - FCN =   4.556029051722 Edm =    0.0823377 NCalls =    152
VariableMetric: Iteration #   7 - FCN =   4.556029051722 Edm =    0.0823377 NCalls =    152
Info: VariableMetricBuilder: Tolerance is not sufficient, continue the minimization
Info in Current  Edm is : edm = 0.0823377
Info in Required Edm is : edmval = 0.002
VariableMetric: Iteration #   8 - FCN =   4.476097792467 Edm =   0.00246463 NCalls =    165
VariableMetric: Iteration #   9 - FCN =   4.473988356004 Edm =    5.727e-05 NCalls =    178

============= OUTPUT FROM MIGRAD STEP ==============

Minuit did successfully converge.
# of function calls: 178
minimum function Value: 4.473988356004
minimum edm: 5.726997259221e-05
minimum internal state vector: LAVector parameters:
    -0.9666789115697
    -0.9583534822507
    -0.9515582959783
     -1.059631311471
    -0.9199248160373
    -0.9736282570089

minimum internal covariance matrix: LASymMatrix parameters:
   0.0040357264 -0.00033686465 -0.00057112663 -0.00064862698  -0.0001422839  -0.0013036399
 -0.00033686465   0.0024825049   -0.001147331 -4.6292979e-05 -0.00071914945  -0.0015707027
 -0.00057112663   -0.001147331  0.00067632323  0.00014074665  0.00037608526   0.0010024361
 -0.00064862698 -4.6292979e-05  0.00014074665  0.00020349194   5.284164e-05  0.00027827516
  -0.0001422839 -0.00071914945  0.00037608526   5.284164e-05   0.0002387877  0.00054630726
  -0.0013036399  -0.0015707027   0.0010024361  0.00027827516  0.00054630726   0.0016115951


# ext. ||   Name    ||   type  ||     Value     ||  Error +/- 

   0   ||        b0 || limited ||     0.8849812101511 ||0.1803077984148
   1   ||        b1 || limited ||     0.9087692626569 ||0.1431540064686
   2   ||        c0 || limited ||     0.9283952438061 ||0.07546345946709
   3   ||        c1 || limited ||     0.6391240923498 ||0.03489070236018
   4   ||        c2 || limited ||      1.022219650861 ||0.04681071662603
   5   ||        c3 || limited ||     0.8653433433502 ||0.1128370321398

@StephanH Can you help?

No, not really. In all my work, Minuit just works nicely. @moneta might know more.

Hi,
Yes with large statistics, if doing a binned fit you could have numerical problems when computing the likelihood. How do you compute the likelihood, do you use ROOT , RooFit or your code ?
The issue is not in Minuit but in the function that is provided to Minuit to minimize

Lorenzo

Hi,

I am using my code, implementing the FCN through the FCNBase, basically following this prescription:

https://root.cern.ch/root/htmldoc/guides/minuit2/Minuit2.html#the-users-mboxfcn

Specifically, to build the likelihood I am using the Poisson likelihood chi-square in page 3 of the following reference:

where I add penalty terms to take into account the systematic deviation of the parameters. The predicted number of events for each bin is computed by weighting the MC templates with the parameters.

I do not know if there is a more safe way to implement the likelihood.

Thanks for your help.

Hi,

The procedure is fine, I hope you compute directly the log , i.e. the sum of mu-n*log(mu) for each bin where mu is the number of expected events and n the number of observed ones.
When summing I would reccmend using the Kahan summation, which minimise the numerical error in the sum. We have a class for doing it in ROOT,
see https://root.cern.ch/doc/master/classROOT_1_1Math_1_1KahanSum.html
This might help in computing the likelihood with more precision

Lorenzo

Hello,

yes, I compute the terms for each bin, but I sum them within a for loop. I perform also other sum in for loops, for instance to get the predicted events for each bin.

Moreover, I directly multiply a matrix M (TMatrixD) and vector v (TVectorD) to get the penalty term (something like v* M*v). I will replace this operation and the summation within the for loops with the Kahan summation and post the result of the test.

Thanks for the suggestion.

Antonio

Hi,

I am still experiencing the same problem.

To simplify I just consider the Poisson terms (switching off the penalty constributions), so I am performing the Kahan sum of mu - n + n*log(n/mu) terms (mu is the number of expected events and n the number of observed ones).

The output in this case is the one I reported below, and the profile likelihood looks like this around the minimum:

Maybe the approach of using a binned fit doen not work in this case? But I can only build a binned likelihood.

Thanks for other suggestions.

Antonio

OUTPUT

initial values for parameters of interest:
b0 = 0.7342
b1 = 0.99484

MnSeedGenerator: for initial parameters FCN = 5.874057001141e+13
MnSeedGenerator: Initial state:   - FCN = 5.874057001141e+13 Edm =  1.15797e+14 NCalls =      9
VariableMetric: start iterating until Edm is < 0.002
VariableMetric: Initial state   - FCN = 5.874057001141e+13 Edm =  1.15797e+14 NCalls =      9
VariableMetric: Iteration #   0 - FCN = 5.874057001141e+13 Edm =  1.15797e+14 NCalls =      9
VariableMetric: Iteration #   1 - FCN =     220279841776 Edm =  1.62466e+11 NCalls =     19
VariableMetric: Iteration #   2 - FCN =     123603344472 Edm =  1.64561e+10 NCalls =     27
VariableMetric: Iteration #   3 - FCN =        158279480 Edm =  1.44131e+08 NCalls =     38
VariableMetric: Iteration #   4 - FCN =           224636 Edm =       219745 NCalls =     43
VariableMetric: Iteration #   5 - FCN =               -4 Edm =      5.27001 NCalls =     48
VariableMetric: Iteration #   6 - FCN =               -8 Edm =      3.39937 NCalls =     57
Info: VariableMetricBuilder: no improvement in line search
VariableMetric: Iteration #   7 - FCN =               -8 Edm =      3.39937 NCalls =     59
Info: VariableMetricBuilder: iterations finish without convergence.
Info in VariableMetricBuilder : edm = 7.08092
Info in             requested : edmval = 0.002
VariableMetric: After Hessian   - FCN =               -8 Edm =  3.76771e+08 NCalls =     73
VariableMetric: Iteration #   8 - FCN =               -8 Edm =  3.76771e+08 NCalls =     73
Info: VariableMetricBuilder: Tolerance is not sufficient, continue the minimization
Info in Current  Edm is : edm = 3.76771e+08
Info in Required Edm is : edmval = 0.002
Info: VariableMetricBuilder: no improvement in line search
VariableMetric: Iteration #   9 - FCN =               -8 Edm =  3.76771e+08 NCalls =     84
Info: VariableMetricBuilder: iterations finish without convergence.
Info in VariableMetricBuilder : edm = 3.76771e+08
Info in             requested : edmval = 0.002
Info: VariableMetricBuilder: FunctionMinimum is invalid after second try

Hi,

@moneta or any other expert that might help: do you think there is something else I could try to make the fit work also with such large bin content? Or it might be the case to change method? Like Bayesian with mirginalization of the nusiances, but I am not sure if this wouldn’t reproduce the same problem…

I have also tried to make a sort of internal rebinning (internal to the FCN, by splitting the content of each bin in such a way to reduce the statistics), but this does not seem to help.

Thanks for any other hint.

Antonio

Can you try the summation of mu -n log(mu), it should be better than doing mu -n + n*log(n/m) where you are adding some useless constant term(i.e not depending on mu)

Lorenzo

yes @moneta, sorry. I forgot to mention: I tried to use both mu - nlog(mu) and also a simple chi2 (n - mu)**2/n (since I thought this at the end should be the case given the high statistic). Unfortunatelly in both cases I do not solve the problem.

For the simple chi2 it “seems” that the fit converges (see below), but when I perform the profiling I get a shifted minimum (should be b0 = 0.6 from the fit, and the same thing happens for b1):

I really don’t understand what is going on.

Thanks again for the suggestions.

Antonio

Initial parameter values:

b0 = 0.7342
b1 = 0.99484
c0 = 0.91775
c1 = 0.65241
c2 = 1.01901
c3 = 0.8635

MnSeedGenerator: for initial parameters FCN = 1.945697553707e+14
MnSeedGenerator: Initial state:   - FCN = 1.945697553707e+14 Edm =  4.40091e+14 NCalls =     27
VariableMetric: start iterating until Edm is < 2e-06
VariableMetric: Initial state   - FCN = 1.945697553707e+14 Edm =  4.40091e+14 NCalls =     27
VariableMetric: Iteration #   0 - FCN = 1.945697553707e+14 Edm =  4.40091e+14 NCalls =     27
VariableMetric: Iteration #   1 - FCN = 1.362416550105e+13 Edm =  1.35221e+13 NCalls =     53
VariableMetric: Iteration #   2 - FCN =   237058177783.3 Edm =  1.62261e+11 NCalls =     73
VariableMetric: Iteration #   3 - FCN =   1487606218.203 Edm =  1.24578e+09 NCalls =     89
VariableMetric: Iteration #   4 - FCN =   4156963.927511 Edm =  3.39985e+06 NCalls =    103
VariableMetric: Iteration #   5 - FCN =   3590.370543003 Edm =      3361.52 NCalls =    117
VariableMetric: Iteration #   6 - FCN =   9.874759437987 Edm =      2.73625 NCalls =    131
VariableMetric: Iteration #   7 - FCN =   7.036065324394 Edm =   0.00384476 NCalls =    144
VariableMetric: Iteration #   8 - FCN =   7.032069478253 Edm =  1.33019e-10 NCalls =    157

============= OUTPUT FROM MIGRAD STEP ==============

Minuit did successfully converge.
# of function calls: 157
minimum function Value: 7.032069478253
minimum edm: 1.330190379013e-10
minimum internal state vector: LAVector parameters:
     -0.637718532142
    -0.4142121304884
    -0.9305975012986
      -1.04562659439
     -0.908184829191
    -0.9344208580264

minimum internal covariance matrix: LASymMatrix parameters:
  4.0404906e-15 -3.9281492e-16 -9.6884525e-17  1.1951951e-16 -5.9210979e-17 -1.0756265e-16
 -3.9281492e-16  8.5219684e-16 -3.9946092e-17 -4.3359988e-17 -2.7288428e-17 -6.5379137e-17
 -9.6884525e-17 -3.9946092e-17  1.1088869e-16 -9.4453262e-18 -9.6832698e-18 -3.4046117e-17
  1.1951951e-16 -4.3359988e-17 -9.4453262e-18  8.7585524e-16  2.7277547e-18 -3.4678407e-17
 -5.9210979e-17 -2.7288428e-17 -9.6832698e-18  2.7277547e-18  1.5370099e-16 -1.1733134e-17
 -1.0756265e-16 -6.5379137e-17 -3.4046117e-17 -3.4678407e-17 -1.1733134e-17  3.1034533e-16


# ext. ||   Name    ||   type  ||     Value     ||  Error +/- 

   0   ||        b0 || limited ||     0.6069541004546 ||7.660735923398e-08
   1   ||        b1 || limited ||      0.896296780389 ||4.008557463742e-08
   2   ||        c0 || limited ||     0.9901149782449 ||3.145184113151e-08
   3   ||        c1 || limited ||     0.6738057146488 ||7.41883549038e-08
   4   ||        c2 || limited ||      1.058058068564 ||3.81337058597e-08
   5   ||        c3 || limited ||     0.9787248098882 ||5.234640609864e-08

I am not sure I have understood exactly what is happening here. Are you computing the profile likelihood as function of b0 minimising all other parameters as it is done within Minos ?
Have you tried computing the Minos errors ?
If you can post the program reproducing the problem it would be useful

best regards

Lorenzo

I am not sure I have understood exactly what is happening here. Are you computing the profile likelihood as function of b0 minimising all other parameters as it is done within Minos ?

yes, right. I am building the profile as function of the parameter by fixing it and minimizing w.r.t. all other parameters. This just for a cross-check and to get a feeling of the shape around the minimum.

Have you tried computing the Minos errors ?

yes, I also compute Minos errors, and they look unrealistically small:

1-sigma minos errors: 
par b0: 0.606954 -7.66074e-08 7.66074e-08
par b1: 0.896297 -4.00856e-08 4.00856e-08

If you can post the program reproducing the problem it would be useful

Sure, I will prepare a minimal working example reproducing the problem and post it. It is probable that I am missing something.

Thanks for the support.

Antonio

Hi,

Then when running Minos, it would be interesting to see the log.
But how it is produced the scan plot above showing a minimum for b0 around 0.85 ?

I think such small errors are expected given the large statistics. These Minos error looks to me consistent with the ones obtained from the Hessian matrix.

Lorenzo

Hi,

so, I uploaded a txt file with the log from Minos.

I think such small errors are expected given the large statistics. These Minos error looks to me consistent with the ones obtained from the Hessian matrix.

but then the values of the poi from the fit would be to far away from the true values, I mean, not compatible. It looks more reasonable the minimum from the “manual” scan. Maybe I am getting confused…

When I apply Hesse, I get something that I interpreted as not much reliable, since the covariance matrix status is 2. The log is in OUTPUT-1.

But how it is produced the scan plot above showing a minimum for b0 around 0.85 ?

This is produced by using migrad for each point: the starting point is near the minimum found by the initial minimization (for b0 the value is 0.6), then I iterate for b0 values that move away from the minimum.

Antonio

minos_log.txt (33.9 KB)

OUTPUT-1

============= OUTPUT FROM HESSE STEP ==============

# of function calls: 220
function Value: 7.032069478253
expected distance to the Minimum (edm): 2.970483266889e-10
external parameters: 
# ext. ||   Name    ||   type  ||     Value     ||  Error +/- 

   0   ||        b0 || limited ||     0.6069541004546 ||1.658345941902e-06
   1   ||        b1 || limited ||      0.896296780389 ||7.293672876219e-07
   2   ||        c0 || limited ||     0.9901149782449 ||3.481822086204e-07
   3   ||        c1 || limited ||     0.6738057146488 ||2.383161526454e-07
   4   ||        c2 || limited ||      1.058058068564 ||2.05883902149e-07
   5   ||        c3 || limited ||     0.9787248098882 ||5.936370880977e-07



covariance matrix status: 2
covariance matrix: 
MnUserCovariance: 

  2.75011e-12 -5.67386e-13 -2.31483e-13 -3.73249e-13  5.11066e-15 -6.64132e-13
 -5.67386e-13  5.31977e-13 -1.56523e-13  6.34979e-14 -1.31279e-13 -1.42786e-13
 -2.31483e-13 -1.56523e-13  1.21231e-13  3.80681e-14  6.36851e-14  1.93662e-13
 -3.73249e-13  6.34979e-14  3.80681e-14  5.67946e-14  3.54615e-15  9.92467e-14
  5.11066e-15 -1.31279e-13  6.36851e-14  3.54615e-15  4.23882e-14  8.65851e-14
 -6.64132e-13 -1.42786e-13  1.93662e-13  9.92467e-14  8.65851e-14  3.52405e-13

MnUserCovariance Parameter correlations: 

            1    -0.469091    -0.400902     -0.94443    0.0149685    -0.674618
    -0.469091            1    -0.616348     0.365308    -0.874234    -0.329776
    -0.400902    -0.616348            1     0.458776     0.888401     0.936951
     -0.94443     0.365308     0.458776            1    0.0722739     0.701522
    0.0149685    -0.874234     0.888401    0.0722739            1     0.708434
    -0.674618    -0.329776     0.936951     0.701522     0.708434            1

global correlation coefficients : 
MnGlobalCorrelationCoeff: 

     0.997715
     0.997715
     0.995163
     0.948521
     0.982068
     0.995264



Eigenvalue-0 = 8.31084e-16
Eigenvalue-1 = 1.43441e-15
Eigenvalue-2 = 2.46679e-15
Eigenvalue-3 = 5.61024e-15
Eigenvalue-4 = 7.46583e-13
Eigenvalue-5 = 3.09798e-12

Hi,

Thank you for the log. I see that Minos failed for both b0 and b1 (lower error). I am not sure if the upper error determination works.

The scan figure of chi2 vs b0 cannot be true. The minimum should be at b0 ~ 0.6 and if the error are so small the parabola should be much narrower around the minimum.

I think I would need to run your code to see what is really happening

Lorenzo

Hi @moneta,

I managed to setup a test code that reproduces what I am doing.

Within fitTest, the fN parameter allows to set the normalization coefficient to reproduce the expected statistics for data. There are two values, one for low statistics, where the fit is working (the likelihood profiles are as I would expect them), and one for high statistics, where the fit is showing the behaviour I discussed.

In Chi2FCN there is the possibility to use a simple chi2 or the mu -n + n*log(n/m) (did not manage to make mu - n*log(m) converge).

Thanks,
Antonio

test_code.tar.gz (8.3 KB)

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

Hi,

I see your code performs several fits and many of them fail because of precision issues. It is difficult to me to find the problem mentioned before with Minos.
Can you please simplify the code, so I can exactly reproduce the Minos problem ?
Thank you

Lorenzo