Re: Strange TGraph

From: Rene Brun <Rene.Brun_at_cern.ch>
Date: Thu, 17 Sep 2009 09:54:00 +0200


In the first case you define a general function for which you have to provide initial values for the parameters. The fit may stop when finding a local minimum if your initial values are bad. In the second case, the linear fitter is called because it knows that it is a simple polynomial
and it has simply to solve a set of linear equations.

Rene Brun

Stefano Mandelli wrote:
> Dear Root users,
>
> Sorry for my bad english but it's better that i can.
>
> i have a question about the using of Fit mode in the TGraph.
>
> I try to fit my data in two different way:
>
> first - define a function : TF1 *f1 = new
> TF1("F1","[0]+[1]*x+[2]*x^2+[3]*x^3+[4]*x^4+[5]*x^5",0.,10.);
>
> second way - using g1->Fit("pol5");
>
> The function is equal in both cases, but the second interpolation is
> better. Why?
> The second way using a spline code?
>
> Thanks of all
> Regards
> Stefano Mandelli.
>
Received on Thu Sep 17 2009 - 09:53:33 CEST

This archive was generated by hypermail 2.2.0 : Thu Sep 17 2009 - 17:50:03 CEST