Re: Q: Fitting (x,y,f(x,y)) data

Rene Brun (Rene.Brun@cern.ch)
Thu, 13 Mar 1997 09:25:05 +0100


Matthias Vitt wrote:
>
> Hi,
>
> I wonder if there is a way to fit a set of data points with a function
> g(x,y) where the data is given in (x,y,z) pairs (z is a function of
> (x,y)).
> thanks for any help.
>

Currently ROOT supports minimization for:
- 1-D histograms via TH1::Fit
- 2-D histograms via TH1::Fit
- non-equidistant points y(i) = f(x(i)) via TGraph::Fit

In your case, you can:
- create a TH2F (2-D histogram) if your points are equidistants
and use TH1::Fit

- or implement your own minimization function (simple chisquare)
as illustrated in the ROOT test example called "minexam"
that you can find in the directory test in the root distribution.

For the release of version 1.00, I want to prepare an HowtoFit tutorial
illustrating the various possibilities.

Rene Brun