RE: TMinuit

From: Snyder, Arthur E. <snyder_at_slac.stanford.edu>
Date: Mon, 31 May 2010 11:54:48 -0700


This could be your |fcn|. Are the parameters really independent? If are parameter is 'redundant' or numerically nearly so you 'info' matrix will be singular and can't be inverted. |Minuit| attempts to get by this by forcing it positive definite. Most likely this as nothing to do with |TMinuit| as such, but would a occur with any minimizer (though exactly how they handle it would be different).

Sometimes it might just be your starting value. If they are in a region where they are nearly redundant, |minuit| might not be able to escape though I think the reason for adding to matrix is an attempt to escape such regions. An example of this kind of thing would be a fit to two Gaussians where they are both given the same initial mean and sigma. Any way you might get somewhere by trying to start as close as you can to what the final fit will be, but at least at a point where the shapes associated with each shape parameter are different.

I don't see where you set initial values at all. Did you? If normalization of a PDF is left zero, then derivatives w.r.t. shape parameters will be zero ... driving |minuit| crazy ...

-Art S.



From: owner-roottalk_at_lxroot01.cern.ch [owner-roottalk_at_lxroot01.cern.ch] On Behalf Of davidesgalaberna_at_libero.it [davidesgalaberna_at_libero.it] Sent: Monday, May 31, 2010 8:07 AM
To: roottalk_at_lxroot01.cern.ch
Subject: [ROOT] TMinuit

Hi,

i'm Davide Sgalaberna. I have some problems with TMinuit. I have to do a likelihood fit. I use both MIGRAD and MINOS for the fit.

When the job calls MINOS it hungs.

This is the main part of code:

  double arglist[10];

          int ierflg = 0;

          TMinuit *MYgMinuit = new TMinuit(4); // Max 4 parameters to be fitted: Cross,JES,Nb_1tag,Nb_2Mtag

          MYgMinuit->SetFCN(fcn); // fcn is a likelihood function

// set PRINT / NO PRINT (arglist[0] = -1/0/1/2/3

          arglist[0] = 2;
          MYgMinuit->mnexcm("SET PRI", arglist, 1, ierflg);


// set WARNINGS / NO WARNINGS (arglist[0] = 1/-1)
arglist[0] = +1; MYgMinuit->mnexcm("SET WAR", arglist, 1, ierflg);
// set accurancy
arglist[0] = 1.E-15L; MYgMinuit->mnexcm("SET EPS", arglist, 1, ierflg);
// set error (0.5 for likelihood, 1 for Chi2)
arglist[0] = 0.5; MYgMinuit->mnexcm("SET ERR", arglist, 1, ierflg);
// set strategy (default is 1, 2 is the more accurate)
arglist[0] = 1.0; //arglist [0] = 2.0; MYgMinuit->mnexcm("SET STR", arglist, 1, ierflg); MYgMinuit->mnexcm("CLE",arglist,0,ierflg); MYgMinuit->mncler(); /// it should be the same as mnexcm("CLE",arglist,0,
ierflg);

// after some code lines, after setting vstart and vstep of my fit parameters:

 cout << " Executing fit with " <<NUMFITPAR << " parameters " << endl;

              cout << " Call MIGRAD " << endl;

              arglist[0] = 10000;   //100000; // max iterations
              arglist[1] = 0.1;    // related to errors

              MYgMinuit->mnexcm("MIGRAD",arglist,2,ierflg);  // do it

              // calculate MINOS errors for all the parameters

              cout << " Call MINOS " << endl;

              arglist[0] = 10000;                // 100000;
              MYgMinuit->mnexcm("MINOS",arglist,1,ierflg);  // do it



The job hunged after the warnings below:

This is the cout before stopping:

  NO. NAME VALUE ERROR SIZE DERIVATIVE    1 CROSS_fit 7.90840e+00 7.07366e-01 4.58159e-02 1.59218e-03

   2  JES_fit     -1.76171e+00   2.88172e-01   2.36167e-02  -1.36947e-02
   3  Bkg_fit_1tag   4.00907e+03   8.20403e+01   6.83956e+00  -2.79731e-06
   4  Bkg_fit_2Mtag   1.22077e+03   3.45308e+01   3.15515e+00   2.61296e-05
                               ERR DEF= 0.5
 Call MINOS
I don't understand what can give this problem

Thanks
Davide Received on Mon May 31 2010 - 20:55:10 CEST

This archive was generated by hypermail 2.2.0 : Tue Jun 01 2010 - 23:50:01 CEST