#define Ndim 4 #define NN 5 //this is a test for y = 0.1*x[0] + 0.2*x[1] + 0.3*x[2] + 0.4*x[3] void test() { // Double_t *x=new Double_t[NN*Ndim]; // Double_t *y=new Double_t[NN]; double x[NN*Ndim]; double y[5] = {1.1, 2.1, 2.9, 4.05, 5.1}; double e[5] = {0.1}; for(int i=0; iSetFormula("[0]*x[0]++[1]*x[1]++[2]*x[2]++[3]*x[3]"); lf->SetFormula("x[0]++x[1]++x[2]++x[3]"); lf->AssignData(NN, Ndim, x, y, e); // lf->FixParameter(1, 0.1); lf->Eval(); TVectorD params; TVectorD errors; lf->GetParameters(params); lf->GetErrors(errors); for (Int_t i=0; iGetChisquare(); printf("chisquare=%f\n", chisquare); }