library: libMinuit #include "TLinearFitter.h" |
TLinearFitter
class description - source file - inheritance tree (.pdf)
private:
void AddToDesign(Double_t* x, Double_t y, Double_t e)
void Graph2DLinearFitter()
void GraphLinearFitter()
void HistLinearFitter()
void MultiGraphLinearFitter()
public:
TLinearFitter()
TLinearFitter(Int_t ndim, const char* formula, Option_t* opt = "D")
TLinearFitter(Int_t ndim)
TLinearFitter(TFormula* function, Option_t* opt = "D")
virtual ~TLinearFitter()
virtual void AddPoint(Double_t* x, Double_t y, Double_t e = 1)
virtual void AssignData(Int_t npoints, Int_t xncols, Double_t* x, Double_t* y, Double_t* e = 0)
virtual void Chisquare()
virtual Double_t Chisquare(Int_t, Double_t*) const
static TClass* Class()
virtual void Clear(Option_t* option)
virtual void ClearPoints()
virtual void Eval()
virtual Int_t ExecuteCommand(const char* command, Double_t*, Int_t)
virtual void FixParameter(Int_t ipar)
virtual void FixParameter(Int_t ipar, Double_t parvalue)
virtual Double_t GetChisquare()
virtual Double_t* GetCovarianceMatrix() const
virtual void GetCovarianceMatrix(TMatrixD& matr)
virtual Double_t GetCovarianceMatrixElement(Int_t i, Int_t j) const
virtual void GetErrors(TVectorD& vpar)
virtual Int_t GetErrors(Int_t, Double_t&, Double_t&, Double_t&, Double_t&) const
virtual Int_t GetNumberFreeParameters() const
virtual Int_t GetNumberTotalParameters() const
virtual Double_t GetParameter(Int_t ipar) const
virtual Int_t GetParameter(Int_t, char*, Double_t&, Double_t&, Double_t&, Double_t&) const
virtual void GetParameters(TVectorD& vpar)
virtual Double_t GetParError(Int_t ipar) const
virtual Double_t GetParSignificance(Int_t ipar) const
virtual Double_t GetParTValue(Int_t ipar) const
virtual Int_t GetStats(Double_t&, Double_t&, Double_t&, Int_t&, Int_t&) const
virtual Double_t GetSumLog(Int_t)
virtual TClass* IsA() const
virtual Bool_t IsFixed(Int_t ipar) const
virtual void PrintResults(Int_t level, Double_t amin = 0) const
virtual void ReleaseParameter(Int_t ipar)
virtual void SetDim(Int_t n)
virtual void SetFitMethod(const char*)
virtual void SetFormula(const char* formula)
virtual void SetFormula(TFormula* function)
virtual Int_t SetParameter(Int_t, const char*, Double_t, Double_t, Double_t, Double_t)
virtual void ShowMembers(TMemberInspector& insp, char* parent)
virtual void StoreData(Bool_t store)
virtual void Streamer(TBuffer& b)
void StreamerNVirtual(TBuffer& b)
virtual Bool_t UpdateMatrix()
private:
TVectorD fParams vector of parameters
TMatrixDSym fParCovar matrix of parameters' covariances
TVectorD fTValues T-Values of parameters
TVectorD fParSign significance levels of parameters
TMatrixDSym fDesign matrix AtA
TMatrixDSym fDesignTemp ! temporary matrix, used for num.stability
TMatrixDSym fDesignTemp2 !
TMatrixDSym fDesignTemp3 !
TVectorD fAtb vector Atb
TVectorD fAtbTemp ! temporary vector, used for num.stability
TVectorD fAtbTemp2 !
TVectorD fAtbTemp3 !
Bool_t* fFixedParams array of fixed/released params
TObjArray fFunctions array of basis functions
TVectorD fY the values being fit
Double_t fY2 sum of square of y, used for chisquare
Double_t fY2Temp ! temporary variable used for num.stability
TMatrixD fX values of x
TVectorD fE the errors if they are known
TFormula* fInputFunction the function being fit
Int_t fNpoints number of points
Int_t fNfunctions number of basis functions
Int_t fFormulaSize length of the formula
Int_t fNdim number of dimensions in the formula
Int_t fNfixed number of fixed parameters
Int_t fSpecial =100+n if fitting a polynomial of deg.n
char* fFormula the formula
Bool_t fIsSet Has the formula been set?
Bool_t fStoreData Is the data stored?
Bool_t fCorrect correcting for the case y>>e
Double_t fChisquare Chisquare of the fit
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)
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)
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"). 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()
Linear fitter cleanup.
void AddPoint(Double_t *x, Double_t y, Double_t e)
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)
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 Clear(Option_t * /*option*/)
Clears everything. Used in TH1::Fit().
void ClearPoints()
To be used when different sets of points are fitted with the same formula.
void Chisquare()
Calculates the chisquare.
void Eval()
Evaluate the function.
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.
Double_t GetChisquare()
Get the Chisquare.
void GetCovarianceMatrix(TMatrixD &matr)
void GetErrors(TVectorD &vpar)
void GetParameters(TVectorD &vpar)
Double_t GetParError(Int_t ipar) const
void SetDim(Int_t ndim)
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 "x0++x1++x2"
2.TMath functions can be used:
fitting function: a0*TMath::Gaus(x0, 0, 1) + a1*x1
input formula: "TMath::Gaus(x0, 0, 1)++x1"
fills the array of functions
void SetFormula(TFormula *function)
Set the fitting function.
Bool_t UpdateMatrix()
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*/) const
Level = 3 (to be consistent with minuit) prints parameters and parameter
errors.
void GraphLinearFitter()
Used in TGraph::Fit().
void Graph2DLinearFitter()
void MultiGraphLinearFitter()
void HistLinearFitter()
Minimization function for H1s using a Chisquare method.
Inline Functions
void GetCovarianceMatrix(TMatrixD& matr)
Double_t GetCovarianceMatrixElement(Int_t i, Int_t j) const
Int_t GetNumberTotalParameters() const
Int_t GetNumberFreeParameters() const
Double_t GetParameter(Int_t ipar) const
Double_t GetParTValue(Int_t ipar) const
Double_t GetParSignificance(Int_t ipar) const
Bool_t IsFixed(Int_t ipar) const
void StoreData(Bool_t store)
Double_t Chisquare(Int_t, Double_t*) const
Int_t GetErrors(Int_t, Double_t&, Double_t&, Double_t&, Double_t&) const
Int_t GetParameter(Int_t, char*, Double_t&, Double_t&, Double_t&, Double_t&) const
Int_t GetStats(Double_t&, Double_t&, Double_t&, Int_t&, Int_t&) const
Double_t GetSumLog(Int_t)
void SetFitMethod(const char*)
Int_t SetParameter(Int_t, const char*, Double_t, Double_t, Double_t, Double_t)
TClass* Class()
TClass* IsA() const
void ShowMembers(TMemberInspector& insp, char* parent)
void Streamer(TBuffer& b)
void StreamerNVirtual(TBuffer& b)
Author: Anna Kreshuk 04/03/2005
Last update: root/minuit:$Name: $:$Id: TLinearFitter.cxx,v 1.8 2005/04/29 16:10:42 brun Exp $
Copyright (C) 1995-2005, Rene Brun and Fons Rademakers. *
ROOT page - Class index - Class Hierarchy - Top of the page
This page has been automatically generated. If you have any comments or suggestions about the page layout send a mail to ROOT support, or contact the developers with any questions or problems regarding ROOT.