Re: [ROOT] Help with TMinuit

From: Rene Brun (Rene.Brun@cern.ch)
Date: Tue Nov 06 2001 - 12:51:45 MET


Hi Luigi,

If you want to fit a function with many parameters to an histogram 1 or 2-d,
I STRONGLY suggest to use TH1::Fit instead of implementing yourself
the fitting procedure directly with Minuit.
We have many examples with fitting in the tutorials.
TH1::Fit (see also TGraph::Fit) implements a Chisquare method and also
a Loglikelihood method for fitting.
In case you would like to use TMinuit directly, you can find examples of use
in the TH1 fit procedures. Look first at:
   http://root.cern.ch/root/htmldoc/src/TH1.cxx.html#TH1:Fit
then look at the functions H1FitChisquare and H1FitLikelihood.

Rene Brun

Bardelli Luigi wrote:
> 
> I'm trying a multidimensional fit using the TMinuit class with my custom
> FCN to be minimized: after some documentation, these are the questions
> left:
> 
> - What is the exact meaning of the void MyFunc(Int_t &npar, Double_t *gin,
> Double_t &f, Double_t *u, Int_t flag)  arguments of the custom
> function (set by SetFCN) ?
> Moverover which is the input and which the output of MyFunc ?
> 
> - Defining a parameter: the TMinuit::DefineParameter method allows to set
> a parameter with limits; how can I set one parameter without?
> 
> Asking for an advice:
> Having a function with many parameters, and no analytical derivative,
> which is the best approach to fit the data? Is it correct to use the
> "raw" TMinuit ?
> 
> (I'm using ROOT Version 3.00/02)
> 
> Thanks for any help
> 
> Luigi
> 
> -------------------------------
>  Luigi Bardelli
>  INFN Sezione di Firenze
>  E-Mail: bardelli@fi.infn.it
> -------------------------------



This archive was generated by hypermail 2b29 : Tue Jan 01 2002 - 17:51:06 MET