Run my “example macro” without any modifications.
If you want to use another fit function , make sure that it is really able to describe your data and make sure that you set “reasonable” initial values for all its parameters (before trying to fit).
See also:
The “distance of each point to the curve ” depends on the curve’s equation.
For examples fitting an ellipse to a set of data points, see:
${ROOTSYS}/tutorials/fit/fitEllipseTGraphRMM.cxx
${ROOTSYS}/tutorials/fit/fitEllipseTGraphDLSF.cxx
Hi Paola,
TGraph is a “single valued function”, i.e. for a X-value you can have only 1 Y-value.
An ellipse in x-y space is not single valued.
I made an example which fits an ellipse to a TH2D:
Some (hopefully useful) ROOT macros
which you may use as a guide how to use Minuit directly.
Cheers
Otto