Chi2 minimization with fumili

Dear root people,

I’d like to use TFumili to do a chisquare minimization (root 5.08.00). I was wondering if anyone has an example ready (like minexam.C or so) or could point me to some documentation about differences between Minuit and Fumili.

Thanks !

Anne-Catherine

minexam.cxx can use any fitter: Minuit, Minuit2, Fumili, Fumili2.
The default fitter is Minuit.
To set Fumili as the default fitter, add

TVirtualFitter::SetDefaultFitter("Fumili");
before the line

TVirtualFitter *minuit = TVirtualFitter::Fitter(0, 5);
see also the tutorials like minuit2…C

Rene

Hello,

I finally tried with root 5.10.00 but did not manage to use fumili :frowning:

Following code seems fine when calling Minuit but not Fumili or Fumili2.

TVirtualFitter::SetDefaultFitter(“Fumili”);
TVirtualFitter *fumili = TVirtualFitter::Fitter(0, 7);
printf(“Starting timer\n”);
TStopwatch timer;
timer.Start();
fumili->SetFCN(FCN);

double arglist[10];

fumili->SetParameter(0, “a1”, vstart[0], step[0],0,0);
fumili->SetParameter(1, “a2”, vstart[1], step[1],0,0);
fumili->SetParameter(2, “a3”, vstart[2], step[2],0,0);
fumili->SetParameter(3, “a4”, vstart[3], step[3],0,0);
fumili->SetParameter(4, “a5”, vstart[4], step[4],0,0);
fumili->SetParameter(5, “a6”, vstart[5], step[5],0,0);
fumili->SetParameter(6, “a7”, vstart[6], step[6],0,0);
arglist[0] = 0;
fumili->ExecuteCommand(“SET PRINT”, arglist, 1);
arglist[0] = 5000;
arglist[1] = 1.;
fumili->ExecuteCommand(“MIGRAD”, arglist, 0);
printf(“Time at the end of job = %f seconds\n”,timer.CpuTime());

What is missing ? Is it because I need to provide the derivatives ?

Thanks !

Anne-Catherine

To use Fumili, you must compute the derivatives.
This, is in general not so trivial.
In ROOT, the use of Fumili is via TH1::Fit where derivatives are computed
for you. I suggest to use TH1::Fit if this is possible in your case.

REne

Thanks for your answer.
Unfortunately I can’t use a histogram.
Which derivatives need to be computed and how are they passed by in
void FCN(int &npar, double *gin, double &f, double *par, int iflag)
{} ?

Many thanks,
Regards,

Anne-Catherine