78 cout <<
"Perform the fit y = c0 + c1 * x in four different ways" << endl;
80 const Int_t nrVar = 2;
81 const Int_t nrPnts = 4;
98 cout <<
" - 1. solve through Normal Equations" << endl;
102 cout <<
" - 2. solve through SVD" << endl;
117 cout <<
" - 3. solve with pseudo inverse" << endl;
121 c_pseudo1 *= pseudo1;
123 cout <<
" - 4. solve with pseudo inverse, calculated brute force" << endl;
128 c_pseudo2 *= pseudo2;
130 cout <<
" - 5. Minuit through TGraph" << endl;
149 cout <<
" All solutions are the same within tolerance of " << eps << endl;
151 cout <<
" Some solutions differ more than the allowed tolerance of " << eps << endl;
TVectorD NormalEqn(const TMatrixD &A, const TVectorD &b)
Solve min {(A .
virtual TFitResultPtr Fit(const char *formula, Option_t *option="", Option_t *goption="", Axis_t xmin=0, Axis_t xmax=0)
Fit this graph with function with name fname.
virtual int Load(const char *module, const char *entry="", Bool_t system=kFALSE)
Load a shared library.
TMatrixT< Element > & T()
TVectorT< Element > & Use(Int_t lwb, Int_t upb, Element *data)
Use the array data to fill the vector lwb..upb].
TMatrixTRow< Double_t > TMatrixDRow
R__EXTERN TSystem * gSystem
Bool_t Invert(TMatrixD &inv)
For a matrix A(m,n), its inverse A_inv is defined as A * A_inv = A_inv * A = unit The user should alw...
void solveLinear(Double_t eps=1.e-12)
virtual Bool_t Solve(TVectorD &b)
Solve Ax=b assuming the SVD form of A is stored .
virtual Double_t GetParameter(Int_t ipar) const
TMatrixTSym< Element > & Invert(Double_t *det=0)
Invert the matrix and calculate its determinant Notice that the LU decomposition is used instead of B...
TMatrixTColumn< Double_t > TMatrixDColumn
A TGraphErrors is a TGraph with error bars.
Bool_t VerifyVectorIdentity(const TVectorT< Element > &m1, const TVectorT< Element > &m2, Int_t verbose, Element maxDevAllow)
Verify that elements of the two vectors are equal within maxDevAllow .