Not defining fitting parameter gives a better fit

Hi everyone,

I define this fitting function:

TF1 *Cosine = new TF1(“Cosine”, “[0]cos(1.e6[1]*x) -1. + [2]”, t0, tmax);

and I get this result from the fit:

Minimizer is Minuit / Migrad
Chi2                      = 1.350178747317e-10
NDf                       =         9996
Edm                       = 2.69445426695e-10
NCalls                    =           44
                          = 1.000000108898   +/-   1.667279042214e-09
#omega                = 7.865440737302   +/-   2.775765883295e-10
                          = 1.00000008007   +/-   1.169006249596e-09

which is good. I am only interested in the parameter omega and its comparison with the analytic value. If I define instead:

TF1 *Cosine = new TF1(“Cosine”, “[0]cos(1.e6[1]*x) -1. + [3]”, t0, tmax);

I get the following result (see that I changed the parameter [2] for [3]):

Minimizer is Minuit / Migrad
Chi2                      = 1.344104546597e-10
NDf                       =         9995
Edm                       = 5.90438077721e-10
NCalls                    =          191
                          = 1.000000108898   +/-   1.654223854588e-09
#omega              = 7.86534073805   +/-   2.762878919271e-10
                          = -2827.427157079   +/-   4.919957807864e-08
Error in <TFormula::GetParName>: Parameter with index 3 not found !!
                          = 1.00000008007   +/-   1.159703162969e-09
Error in <TFormula::GetParName>: Parameter with index 3 not found !!

I think that ROOT considered another parameter [2] not included in my function for the fit, but I don’t know how it is working. The thing is that this value for omega is closer to the analytic value, which I could say that this fit is better. How is this possible? Is it just a coincidence?

Thank you.

ROOT Version: 6.12/04


If you are using the functions for fitting you cannot really leave a parameter on which the function does not depend (e.g. the parameter [2]). This can confuse Minuit. At least you should fix it.


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