Fitting graphs and parameter profile

Dear ROOT people,

I am new in the forum but I have been using ROOT a little for my work. Here is my question (don’t know if I am posting in the right place):
I am fitting a graph using the basic fitting routines and using TVirtualFitter to retrieve the fit results and I can obtain the uncertainty on the parameter value on both sides using the code below (I have 4 parameters):

graph->Fit(f1,"E"); TVirtualFitter *fitter = TVirtualFitter::GetFitter(); double eup,elo,epar,glob; for (int i=0;i<4;i++) { cout << "Paramter "<<i<<": "<<fitter->GetParameter(i)<<"\t"<<fitter->GetParError(i)<<endl; fitter->GetErrors(i,eup,elo,epar,glob); cout << "par "<<i<<": " <<eup <<"\t"<<elo<<"\t"<<epar<<"\n"; }

Because of poor statistics of the data, for one of the parameters I obtain that the lower error is 0.

Paramter 0: 5.43812e-06 5.46689e-06 par 0: 1.60752e-05 0 5.46689e-06

I was wondering if it is possible to produce the parameter profile to test if there are some problems in the fit.
What I would like to have is the value of the chi2 when I scan the possible values of the parameter.
I have been looking into the documentation but I could not find what I need. Is there some easy method?
I could write my code to do this job, but if there is already a method implemented it would be very helpful.

Cheers!

Hi,

Yes, there is already a way to do this in ROOT. For getting the likelihood (or chi2) scan for one parameter value, keeping all the other parameter fixed, you can do as in the attached code example

Best Regards

Lorenzo

LorenzoexampleParamScan.C (576 Bytes)

Hi Lorenzo

Thanks for your kind reply! I will try it.
Does this method work only fixing the other parameters?
To explore the correlation, I was actually thinking about something that would leave free to vary the other parameters.

Cheers,

Carlo

Hi,

Yes the scan is produced fixing the other parameters. Otherwise you can do a profile likelihood scan (i.e. re-fitting all other parameters to their best fitted value). This functionality however is not yet implemented directly in any method. If you think this is what you need, we could eventually implement it

Cheers

Lorenzo