ROOT logo
ROOT » MATH » MINUIT » TLinearFitter

class TLinearFitter: public TVirtualFitter


 The Linear Fitter - fitting functions that are LINEAR IN PARAMETERS

 Linear fitter is used to fit a set of data points with a linear
 combination of specified functions. Note, that "linear" in the name
 stands only for the model dependency on parameters, the specified
 functions can be nonlinear.
 The general form of this kind of model is

          y(x) = a[0] + a[1]*f[1](x)+...a[n]*f[n](x)

 Functions f are fixed functions of x. For example, fitting with a
 polynomial is linear fitting in this sense.

                         The fitting method

 The fit is performed using the Normal Equations method with Cholesky
 decomposition.

                         Why should it be used?

 The linear fitter is considerably faster than general non-linear
 fitters and doesn't require to set the initial values of parameters.

                          Using the fitter:

 1.Adding the data points:
  1.1 To store or not to store the input data?
      - There are 2 options in the constructor - to store or not
        store the input data. The advantages of storing the data
        are that you'll be able to reset the fitting model without
        adding all the points again, and that for very large sets
        of points the chisquare is calculated more precisely.
        The obvious disadvantage is the amount of memory used to
        keep all the points.
      - Before you start adding the points, you can change the
        store/not store option by StoreData() method.
  1.2 The data can be added:
      - simply point by point - AddPoint() method
      - an array of points at once:
        If the data is already stored in some arrays, this data
        can be assigned to the linear fitter without physically
        coping bytes, thanks to the Use() method of
        TVector and TMatrix classes - AssignData() method

 2.Setting the formula
  2.1 The linear formula syntax:
      -Additive parts are separated by 2 plus signes "++"
       --for example "1 ++ x" - for fitting a straight line
      -All standard functions, undrestood by TFormula, can be used
       as additive parts
       --TMath functions can be used too
      -Functions, used as additive parts, shouldn't have any parameters,
       even if those parameters are set.
       --for example, if normalizing a sum of a gaus(0, 1) and a
         gaus(0, 2), don't use the built-in "gaus" of TFormula,
         because it has parameters, take TMath::Gaus(x, 0, 1) instead.
      -Polynomials can be used like "pol3", .."polN"
      -If fitting a more than 3-dimensional formula, variables should
       be numbered as follows:
       -- x[0], x[1], x[2]... For example, to fit  "1 ++ x[0] ++ x[1] ++ x[2] ++ x[3]*x[3]"
  2.2 Setting the formula:
    2.2.1 If fitting a 1-2-3-dimensional formula, one can create a
          TF123 based on a linear expression and pass this function
          to the fitter:
          --Example:
            TLinearFitter *lf = new TLinearFitter();
            TF2 *f2 = new TF2("f2", "x ++ y ++ x*x*y*y", -2, 2, -2, 2);
            lf->SetFormula(f2);
          --The results of the fit are then stored in the function,
            just like when the TH1::Fit or TGraph::Fit is used
          --A linear function of this kind is by no means different
            from any other function, it can be drawn, evaluated, etc.

          --For multidimensional fitting, TFormulas of the form:
            x[0]++...++x[n] can be used
    2.2.2 There is no need to create the function if you don't want to,
          the formula can be set by expression:
          --Example:
            // 2 is the number of dimensions
            TLinearFitter *lf = new TLinearFitter(2);
            lf->SetFormula("x ++ y ++ x*x*y*y");

    2.2.3 The fastest functions to compute are polynomials and hyperplanes.
          --Polynomials are set the usual way: "pol1", "pol2",...
          --Hyperplanes are set by expression "hyp3", "hyp4", ...
          ---The "hypN" expressions only work when the linear fitter
             is used directly, not through TH1::Fit or TGraph::Fit.
             To fit a graph or a histogram with a hyperplane, define
             the function as "1++x++y".
          ---A constant term is assumed for a hyperplane, when using
             the "hypN" expression, so "hyp3" is in fact fitting with
             "1++x++y++z" function.
          --Fitting hyperplanes is much faster than fitting other
            expressions so if performance is vital, calculate the
            function values beforehand and give them to the fitter
            as variables
          --Example:
            You want to fit "sin(x)|cos(2*x)" very fast. Calculate
            sin(x) and cos(2*x) beforehand and store them in array *data.
            Then:
            TLinearFitter *lf=new TLinearFitter(2, "hyp2");
            lf->AssignData(npoint, 2, data, y);

  2.3 Resetting the formula
    2.3.1 If the input data is stored (or added via AssignData() function),
          the fitting formula can be reset without re-adding all the points.
          --Example:
            TLinearFitter *lf=new TLinearFitter("1++x++x*x");
            lf->AssignData(n, 1, x, y, e);
            lf->Eval()
            //looking at the parameter significance, you see,
            // that maybe the fit will improve, if you take out
            // the constant term
            lf->SetFormula("x++x*x");
            lf->Eval();

    2.3.2 If the input data is not stored, the fitter will have to be
          cleared and the data will have to be added again to try a
          different formula.

 3.Accessing the fit results
  3.1 There are methods in the fitter to access all relevant information:
      --GetParameters, GetCovarianceMatrix, etc
      --the t-values of parameters and their significance can be reached by
        GetParTValue() and GetParSignificance() methods
  3.2 If fitting with a pre-defined TF123, the fit results are also
      written into this function.


 4.Robust fitting - Least Trimmed Squares regression (LTS)
   Outliers are atypical(by definition), infrequant observations; data points
   which do not appear to follow the characteristic distribution of the rest
   of the data. These may reflect genuine properties of the underlying
   phenomenon(variable), or be due to measurement errors or anomalies which
   shouldn't be modelled. (StatSoft electronic textbook)

   Even a single gross outlier can greatly influence the results of least-
   squares fitting procedure, and in this case use of robust(resistant) methods
   is recommended.

   The method implemented here is based on the article and algorithm:
   "Computing LTS Regression for Large Data Sets" by
   P.J.Rousseeuw and Katrien Van Driessen
   The idea of the method is to find the fitting coefficients for a subset
   of h observations (out of n) with the smallest sum of squared residuals.
   The size of the subset h should lie between (npoints + nparameters +1)/2
   and n, and represents the minimal number of good points in the dataset.
   The default value is set to (npoints + nparameters +1)/2, but of course
   if you are sure that the data contains less outliers it's better to change
   h according to your data.

   To perform a robust fit, call EvalRobust() function instead of Eval() after
   adding the points and setting the fitting function.
   Note, that standard errors on parameters are not computed!


Function Members (Methods)

public:
TLinearFitter()
TLinearFitter(Int_t ndim)
TLinearFitter(const TLinearFitter& tlf)
TLinearFitter(TFormula* function, Option_t* opt = "D")
TLinearFitter(Int_t ndim, const char* formula, Option_t* opt = "D")
virtual~TLinearFitter()
voidTObject::AbstractMethod(const char* method) const
virtual voidAdd(TLinearFitter* tlf)
virtual voidAddPoint(Double_t* x, Double_t y, Double_t e = 1)
virtual voidAddTempMatrices()
virtual voidTObject::AppendPad(Option_t* option = "")
virtual voidAssignData(Int_t npoints, Int_t xncols, Double_t* x, Double_t* y, Double_t* e = 0)
virtual voidTObject::Browse(TBrowser* b)
virtual voidChisquare()
virtual Double_tChisquare(Int_t, Double_t*) const
static TClass*Class()
virtual const char*TObject::ClassName() const
virtual voidClear(Option_t* option = "")
virtual voidClearPoints()
virtual TObject*TNamed::Clone(const char* newname = "") const
virtual Int_tTNamed::Compare(const TObject* obj) const
virtual voidTNamed::Copy(TObject& named) const
virtual voidTObject::Delete(Option_t* option = "")MENU
virtual Int_tTObject::DistancetoPrimitive(Int_t px, Int_t py)
virtual voidTObject::Draw(Option_t* option = "")
virtual voidTObject::DrawClass() constMENU
virtual TObject*TObject::DrawClone(Option_t* option = "") constMENU
virtual voidTObject::Dump() constMENU
virtual voidTObject::Error(const char* method, const char* msgfmt) const
virtual Int_tEval()
virtual Int_tEvalRobust(Double_t h = -1)
virtual voidTObject::Execute(const char* method, const char* params, Int_t* error = 0)
virtual voidTObject::Execute(TMethod* method, TObjArray* params, Int_t* error = 0)
virtual Int_tExecuteCommand(const char* command, Double_t* args, Int_t nargs)
virtual voidTObject::ExecuteEvent(Int_t event, Int_t px, Int_t py)
virtual voidTObject::Fatal(const char* method, const char* msgfmt) const
virtual voidTNamed::FillBuffer(char*& buffer)
virtual TObject*TObject::FindObject(const char* name) const
virtual TObject*TObject::FindObject(const TObject* obj) const
static TVirtualFitter*TVirtualFitter::Fitter(TObject* obj, Int_t maxpar = 25)
virtual voidFixParameter(Int_t ipar)
virtual voidFixParameter(Int_t ipar, Double_t parvalue)
virtual voidGetAtbVector(TVectorD& v)
virtual Double_tGetChisquare()
virtual voidGetConfidenceIntervals(TObject* obj, Double_t cl = 0.95)
virtual voidGetConfidenceIntervals(Int_t n, Int_t ndim, const Double_t* x, Double_t* ci, Double_t cl = 0.95)
virtual Double_t*GetCovarianceMatrix() const
virtual voidGetCovarianceMatrix(TMatrixD& matr)
virtual Double_tGetCovarianceMatrixElement(Int_t i, Int_t j) const
static const char*TVirtualFitter::GetDefaultFitter()
virtual voidGetDesignMatrix(TMatrixD& matr)
virtual Option_t*TObject::GetDrawOption() const
static Long_tTObject::GetDtorOnly()
static Double_tTVirtualFitter::GetErrorDef()
virtual voidGetErrors(TVectorD& vpar)
virtual Int_tGetErrors(Int_t, Double_t&, Double_t&, Double_t&, Double_t&) const
virtual TVirtualFitter::FCNFunc_tTVirtualFitter::GetFCN()
virtual Foption_tTVirtualFitter::GetFitOption() const
virtual voidGetFitSample(TBits& bits)
static TVirtualFitter*TVirtualFitter::GetFitter()
virtual const char*TObject::GetIconName() const
static Int_tTVirtualFitter::GetMaxIterations()
TMethodCall*TVirtualFitter::GetMethodCall() const
virtual const char*TNamed::GetName() const
virtual Int_tGetNpoints()
virtual Int_tGetNumberFreeParameters() const
virtual Int_tGetNumberTotalParameters() const
virtual TObject*TVirtualFitter::GetObjectFit() const
virtual char*TObject::GetObjectInfo(Int_t px, Int_t py) const
static Bool_tTObject::GetObjectStat()
virtual Option_t*TObject::GetOption() const
virtual Double_tGetParameter(Int_t ipar) const
virtual Int_tGetParameter(Int_t ipar, char* name, Double_t& value, Double_t&, Double_t&, Double_t&) const
virtual voidGetParameters(TVectorD& vpar)
virtual Double_tGetParError(Int_t ipar) const
virtual const char*GetParName(Int_t ipar) const
virtual Double_tGetParSignificance(Int_t ipar)
virtual Double_tGetParTValue(Int_t ipar)
static Double_tTVirtualFitter::GetPrecision()
virtual Int_tGetStats(Double_t&, Double_t&, Double_t&, Int_t&, Int_t&) const
virtual Double_tGetSumLog(Int_t)
virtual const char*TNamed::GetTitle() const
virtual UInt_tTObject::GetUniqueID() const
virtual TObject*TVirtualFitter::GetUserFunc() const
virtual Int_tTVirtualFitter::GetXfirst() const
virtual Int_tTVirtualFitter::GetXlast() const
virtual Double_tGetY2() const
virtual Int_tTVirtualFitter::GetYfirst() const
virtual Int_tTVirtualFitter::GetYlast() const
virtual Int_tTVirtualFitter::GetZfirst() const
virtual Int_tTVirtualFitter::GetZlast() const
virtual Bool_tTObject::HandleTimer(TTimer* timer)
virtual ULong_tTNamed::Hash() const
virtual voidTObject::Info(const char* method, const char* msgfmt) const
virtual Bool_tTObject::InheritsFrom(const char* classname) const
virtual Bool_tTObject::InheritsFrom(const TClass* cl) const
virtual voidTObject::Inspect() constMENU
voidTObject::InvertBit(UInt_t f)
virtual TClass*IsA() const
virtual Bool_tTObject::IsEqual(const TObject* obj) const
virtual Bool_tIsFixed(Int_t ipar) const
virtual Bool_tTObject::IsFolder() const
Bool_tTObject::IsOnHeap() const
virtual Bool_tTNamed::IsSortable() const
Bool_tTObject::IsZombie() const
virtual voidTNamed::ls(Option_t* option = "") const
voidTObject::MayNotUse(const char* method) const
virtual Int_tMerge(TCollection* list)
virtual Bool_tTObject::Notify()
voidTObject::Obsolete(const char* method, const char* asOfVers, const char* removedFromVers) const
static voidTObject::operator delete(void* ptr)
static voidTObject::operator delete(void* ptr, void* vp)
static voidTObject::operator delete[](void* ptr)
static voidTObject::operator delete[](void* ptr, void* vp)
void*TObject::operator new(size_t sz)
void*TObject::operator new(size_t sz, void* vp)
void*TObject::operator new[](size_t sz)
void*TObject::operator new[](size_t sz, void* vp)
TLinearFitter&operator=(const TLinearFitter& tlf)
virtual voidTObject::Paint(Option_t* option = "")
virtual voidTObject::Pop()
virtual voidTNamed::Print(Option_t* option = "") const
virtual voidPrintResults(Int_t level, Double_t amin = 0) const
virtual Int_tTObject::Read(const char* name)
virtual voidTObject::RecursiveRemove(TObject* obj)
virtual voidReleaseParameter(Int_t ipar)
voidTObject::ResetBit(UInt_t f)
virtual voidTObject::SaveAs(const char* filename = "", Option_t* option = "") constMENU
virtual voidTObject::SavePrimitive(ostream& out, Option_t* option = "")
virtual voidSetBasisFunctions(TObjArray* functions)
voidTObject::SetBit(UInt_t f)
voidTObject::SetBit(UInt_t f, Bool_t set)
virtual Double_t*TVirtualFitter::SetCache(Int_t npoints, Int_t psize)
static voidTVirtualFitter::SetDefaultFitter(const char* name = "")
virtual voidSetDim(Int_t n)
virtual voidTObject::SetDrawOption(Option_t* option = "")MENU
static voidTObject::SetDtorOnly(void* obj)
static voidTVirtualFitter::SetErrorDef(Double_t errdef = 1)
virtual voidTVirtualFitter::SetFCN(void* fcn)
virtual voidTVirtualFitter::SetFCN(void (*)(Int_t&, Double_t*, Double_t&f, Double_t*, Int_t) fcn)
virtual voidSetFitMethod(const char*)
virtual voidTVirtualFitter::SetFitOption(Foption_t option)
static voidTVirtualFitter::SetFitter(TVirtualFitter* fitter, Int_t maxpar = 25)
virtual voidSetFormula(const char* formula)
virtual voidSetFormula(TFormula* function)
static voidTVirtualFitter::SetMaxIterations(Int_t niter = 5000)
virtual voidTNamed::SetName(const char* name)MENU
virtual voidTNamed::SetNameTitle(const char* name, const char* title)
virtual voidTVirtualFitter::SetObjectFit(TObject* obj)
static voidTObject::SetObjectStat(Bool_t stat)
virtual Int_tSetParameter(Int_t, const char*, Double_t, Double_t, Double_t, Double_t)
static voidTVirtualFitter::SetPrecision(Double_t prec = 1e-6)
virtual voidTNamed::SetTitle(const char* title = "")MENU
virtual voidTObject::SetUniqueID(UInt_t uid)
virtual voidTVirtualFitter::SetUserFunc(TObject* userfunc)
virtual voidTVirtualFitter::SetXfirst(Int_t first)
virtual voidTVirtualFitter::SetXlast(Int_t last)
virtual voidTVirtualFitter::SetYfirst(Int_t first)
virtual voidTVirtualFitter::SetYlast(Int_t last)
virtual voidTVirtualFitter::SetZfirst(Int_t first)
virtual voidTVirtualFitter::SetZlast(Int_t last)
virtual voidShowMembers(TMemberInspector& insp)
virtual Int_tTNamed::Sizeof() const
virtual voidStoreData(Bool_t store)
virtual voidStreamer(TBuffer& b)
voidStreamerNVirtual(TBuffer& b)
virtual voidTObject::SysError(const char* method, const char* msgfmt) const
Bool_tTObject::TestBit(UInt_t f) const
Int_tTObject::TestBits(UInt_t f) const
virtual Bool_tUpdateMatrix()
virtual voidTObject::UseCurrentStyle()
virtual voidTObject::Warning(const char* method, const char* msgfmt) const
virtual Int_tTObject::Write(const char* name = 0, Int_t option = 0, Int_t bufsize = 0)
virtual Int_tTObject::Write(const char* name = 0, Int_t option = 0, Int_t bufsize = 0) const
protected:
virtual voidTObject::DoError(int level, const char* location, const char* fmt, va_list va) const
voidTObject::MakeZombie()

Data Members

protected:
Double_t*TVirtualFitter::fCache[fCacheSize] array of points data (fNpoints*fPointSize < fCacheSize words)
Int_tTVirtualFitter::fCacheSizeSize of the fCache array
voidTVirtualFitter::fFCN
TMethodCall*TVirtualFitter::fMethodCallPointer to MethodCall in case of interpreted function
TStringTNamed::fNameobject identifier
Int_tTVirtualFitter::fNpointsNumber of points to fit
TObject*TVirtualFitter::fObjectFitpointer to object being fitted
Foption_tTVirtualFitter::fOptionstruct with the fit options
Int_tTVirtualFitter::fPointSizeNumber of words per point in the cache
TStringTNamed::fTitleobject title
TObject*TVirtualFitter::fUserFuncpointer to user theoretical function (a TF1*)
Int_tTVirtualFitter::fXfirstfirst bin on X axis
Int_tTVirtualFitter::fXlastlast bin on X axis
Int_tTVirtualFitter::fYfirstfirst bin on Y axis
Int_tTVirtualFitter::fYlastlast bin on Y axis
Int_tTVirtualFitter::fZfirstfirst bin on Z axis
Int_tTVirtualFitter::fZlastlast bin on Z axis
static TStringTVirtualFitter::fgDefaultname of the default fitter ("Minuit","Fumili",etc)
static Double_tTVirtualFitter::fgErrorDefError definition (default=1)
static TVirtualFitter*TVirtualFitter::fgFitterCurrent fitter (default TFitter)
static Int_tTVirtualFitter::fgMaxiterMaximum number of iterations
static Int_tTVirtualFitter::fgMaxparMaximum number of fit parameters for current fitter
static Double_tTVirtualFitter::fgPrecisionmaximum precision
private:
TVectorDfAtbvector Atb
TVectorDfAtbTemp! temporary vector, used for num.stability
TVectorDfAtbTemp2!
TVectorDfAtbTemp3!
Double_tfChisquareChisquare of the fit
TMatrixDSymfDesignmatrix AtA
TMatrixDSymfDesignTemp! temporary matrix, used for num.stability
TMatrixDSymfDesignTemp2!
TMatrixDSymfDesignTemp3!
TVectorDfEthe errors if they are known
TBitsfFitsampleindices of points, used in the robust fit
Bool_t*fFixedParams[fNfixed] array of fixed/released params
char*fFormulathe formula
Int_tfFormulaSizelength of the formula
TObjArrayfFunctionsarray of basis functions
Int_tfHnumber of good points in robust fit
TFormula*fInputFunctionthe function being fit
Bool_tfIsSetHas the formula been set?
Int_tfNdimnumber of dimensions in the formula
Int_tfNfixednumber of fixed parameters
Int_tfNfunctionsnumber of basis functions
Int_tfNpointsnumber of points
TMatrixDSymfParCovarmatrix of parameters' covariances
TVectorDfParSignsignificance levels of parameters
TVectorDfParamsvector of parameters
Bool_tfRobusttrue when performing a robust fit
Int_tfSpecial=100+n if fitting a polynomial of deg.n
Bool_tfStoreDataIs the data stored?
TVectorDfTValuesT-Values of parameters
Double_tfVal[1000]! temporary
TMatrixDfXvalues of x
TVectorDfYthe values being fit
Double_tfY2sum of square of y, used for chisquare
Double_tfY2Temp! temporary variable used for num.stability

Class Charts

Inheritance Inherited Members Includes Libraries
Class Charts

Function documentation

TLinearFitter()
default c-tor, input data is stored
If you don't want to store the input data,
run the function StoreData(kFALSE) after constructor
TLinearFitter(Int_t ndim)
The parameter stands for number of dimensions in the fitting formula
The input data is stored. If you don't want to store the input data,
run the function StoreData(kFALSE) after constructor
TLinearFitter(Int_t ndim, const char* formula, Option_t* opt = "D")
First parameter stands for number of dimensions in the fitting formula
Second parameter is the fitting formula: see class description for formula syntax
Options:
The option is to store or not to store the data
If you don't want to store the data, choose "" for the option, or run
StoreData(kFalse) member function after the constructor
TLinearFitter(TFormula* function, Option_t* opt = "D")
This constructor uses a linear function. How to create it?
TFormula now accepts formulas of the following kind:
TFormula("f", "x++y++z++x*x") or
TFormula("f", "x[0]++x[1]++x[2]*x[2]");
Other than the look, it's in no
way different from the regular formula, it can be evaluated,
drawn, etc.
The option is to store or not to store the data
If you don't want to store the data, choose "" for the option, or run
StoreData(kFalse) member function after the constructor
TLinearFitter(const TLinearFitter& tlf)
 Copy ctor
~TLinearFitter()
 Linear fitter cleanup.
TLinearFitter& operator=(const TLinearFitter& tlf)
 Assignment operator
void Add(TLinearFitter* tlf)
Add another linear fitter to this linear fitter. Points and Design matrices
are added, but the previos fitting results (if any) are deleted.
Fitters must have same formulas (this is not checked). Fixed parameters are not changed
void AddPoint(Double_t* x, Double_t y, Double_t e = 1)
Adds 1 point to the fitter.
First parameter stands for the coordinates of the point, where the function is measured
Second parameter - the value being fitted
Third parameter - weight(measurement error) of this point (=1 by default)
void AssignData(Int_t npoints, Int_t xncols, Double_t* x, Double_t* y, Double_t* e = 0)
This function is to use when you already have all the data in arrays
and don't want to copy them into the fitter. In this function, the Use() method
of TVectorD and TMatrixD is used, so no bytes are physically moved around.
First parameter - number of points to fit
Second parameter - number of variables in the model
Third parameter - the variables of the model, stored in the following way:
(x0(0), x1(0), x2(0), x3(0), x0(1), x1(1), x2(1), x3(1),...
void AddToDesign(Double_t* x, Double_t y, Double_t e)
Add a point to the AtA matrix and to the Atb vector.
void AddTempMatrices()
void Clear(Option_t* option = "")
Clears everything. Used in TH1::Fit and TGraph::Fit().
void ClearPoints()
To be used when different sets of points are fitted with the same formula.
void Chisquare()
Calculates the chisquare.
void ComputeTValues()
 Computes parameters' t-values and significance
Int_t Eval()
 Perform the fit and evaluate the parameters
 Returns 0 if the fit is ok, 1 if there are errors
void FixParameter(Int_t ipar)
Fixes paramter #ipar at its current value.
void FixParameter(Int_t ipar, Double_t parvalue)
Fixes parameter #ipar at value parvalue.
void ReleaseParameter(Int_t ipar)
Releases parameter #ipar.
void GetAtbVector(TVectorD& v)
Get the Atb vector - a vector, used for internal computations
Double_t GetChisquare()
 Get the Chisquare.
void GetConfidenceIntervals(Int_t n, Int_t ndim, const Double_t* x, Double_t* ci, Double_t cl = 0.95)
Computes point-by-point confidence intervals for the fitted function
Parameters:
n - number of points
ndim - dimensions of points
x - points, at which to compute the intervals, for ndim > 1
    should be in order: (x0,y0, x1, y1, ... xn, yn)
ci - computed intervals are returned in this array
cl - confidence level, default=0.95

NOTE, that this method can only be used when the fitting function inherits from a TF1,
so it's not possible when the fitting function was set as a string or as a pure TFormula
void GetConfidenceIntervals(TObject* obj, Double_t cl = 0.95)
Computes confidence intervals at level cl. Default is 0.95
The TObject parameter can be a TGraphErrors, a TGraph2DErrors or a TH123.
For Graphs, confidence intervals are computed for each point,
the value of the graph at that point is set to the function value at that
point, and the graph y-errors (or z-errors) are set to the value of
the confidence interval at that point
For Histograms, confidence intervals are computed for each bin center
The bin content of this bin is then set to the function value at the bin
center, and the bin error is set to the confidence interval value.
Allowed combinations:
Fitted object               Passed object
TGraph                      TGraphErrors, TH1
TGraphErrors, AsymmErrors   TGraphErrors, TH1
TH1                         TGraphErrors, TH1
TGraph2D                    TGraph2DErrors, TH2
TGraph2DErrors              TGraph2DErrors, TH2
TH2                         TGraph2DErrors, TH2
TH3                         TH3
Double_t* GetCovarianceMatrix() const
Returns covariance matrix
void GetCovarianceMatrix(TMatrixD& matr)
Returns covariance matrix
void GetDesignMatrix(TMatrixD& matr)
Returns the internal design matrix
void GetErrors(TVectorD& vpar)
Returns parameter errors
void GetParameters(TVectorD& vpar)
Returns parameter values
Int_t GetParameter(Int_t ipar, char* name, Double_t& value, Double_t& , Double_t& , Double_t& ) const
Returns the value and the name of the parameter #ipar
NB: In the calling function he argument name must be set large enough
Double_t GetParError(Int_t ipar) const
Returns the error of parameter #ipar
const char * GetParName(Int_t ipar) const
Returns name of parameter #ipar
Double_t GetParTValue(Int_t ipar)
Returns the t-value for parameter #ipar
Double_t GetParSignificance(Int_t ipar)
Returns the significance of parameter #ipar
void GetFitSample(TBits& bits)
For robust lts fitting, returns the sample, on which the best fit was based
Int_t Merge(TCollection* list)
Merge objects in list
void SetBasisFunctions(TObjArray* functions)
set the basis functions in case the fitting function is not
 set directly
 The TLinearFitter will manage and delete the functions contained in the list
void SetDim(Int_t n)
set the number of dimensions
void SetFormula(const char* formula)
Additive parts should be separated by "++".
Examples (ai are parameters to fit):
1.fitting function: a0*x0 + a1*x1 + a2*x2
  input formula "x[0]++x[1]++x[2]"
2.TMath functions can be used:
  fitting function: a0*TMath::Gaus(x, 0, 1) + a1*y
  input formula:    "TMath::Gaus(x, 0, 1)++y"
fills the array of functions
void SetFormula(TFormula* function)
Set the fitting function.
Bool_t UpdateMatrix()
Update the design matrix after the formula has been changed.
Int_t ExecuteCommand(const char* command, Double_t* args, Int_t nargs)
To use in TGraph::Fit and TH1::Fit().
void PrintResults(Int_t level, Double_t amin = 0) const
 Level = 3 (to be consistent with minuit)  prints parameters and parameter
 errors.
Int_t GraphLinearFitter(Double_t h)
Used in TGraph::Fit().
Int_t Graph2DLinearFitter(Double_t h)
Minimisation function for a TGraph2D
Int_t MultiGraphLinearFitter(Double_t h)
Minimisation function for a TMultiGraph
Int_t HistLinearFitter()
 Minimization function for H1s using a Chisquare method.
void Streamer(TBuffer& b)
Int_t EvalRobust(Double_t h = -1)
Finds the parameters of the fitted function in case data contains
outliers.
Parameter h stands for the minimal fraction of good points in the
dataset (h < 1, i.e. for 70% of good points take h=0.7).
The default value of h*Npoints is  (Npoints + Nparameters+1)/2
If the user provides a value of h smaller than above, default is taken
See class description for the algorithm details
void CreateSubset(Int_t ntotal, Int_t h, Int_t* index)
Creates a p-subset to start
ntotal - total number of points from which the subset is chosen
Double_t CStep(Int_t step, Int_t h, Double_t* residuals, Int_t* index, Int_t* subdat, Int_t start, Int_t end)
The CStep procedure, as described in the article
Bool_t Linf()
Int_t Partition(Int_t nmini, Int_t* indsubdat)
divides the elements into approximately equal subgroups
number of elements in each subgroup is stored in indsubdat
number of subgroups is returned
void RDraw(Int_t* subdat, Int_t* indsubdat)
Draws ngroup nonoverlapping subdatasets out of a dataset of size n
such that the selected case numbers are uniformly distributed from 1 to n
void Chisquare()
Double_t GetCovarianceMatrixElement(Int_t i, Int_t j) const
{return fParCovar(i, j);}
void GetErrors(TVectorD& vpar)
Int_t GetNumberTotalParameters() const
{return fNfunctions;}
Int_t GetNumberFreeParameters() const
Int_t GetNpoints()
{ return fNpoints; }
Double_t GetParameter(Int_t ipar) const
{return fParams(ipar);}
Double_t GetY2() const
{return fY2;}
Bool_t IsFixed(Int_t ipar) const
{return fFixedParams[ipar];}
void StoreData(Bool_t store)
{fStoreData=store;}
Int_t GetStats(Double_t& , Double_t& , Double_t& , Int_t& , Int_t& ) const
{return 0;}
Double_t GetSumLog(Int_t )
{return 0;}
void SetFitMethod(const char* )
{;}
Int_t SetParameter(Int_t , const char* , Double_t , Double_t , Double_t , Double_t )
{return 0;}