35 x[0 + i*5] = randNum.
Uniform(-10, 10);
36 x[1 + i*5] = randNum.
Uniform(-10, 10);
37 x[2 + i*5] = randNum.
Uniform(-10, 10);
38 x[3 + i*5] = randNum.
Uniform(-10, 10);
39 x[4 + i*5] = randNum.
Uniform(-10, 10);
41 y[i] = 4*x[0+i*5] + x[1+i*5] + 2*x[2+i*5] + 3*x[3+i*5] + 0.2*x[4+i*5] + randNum.
Gaus()*e[i];
56 for (
Int_t i=0; i<6; i++)
57 printf(
"par[%d]=%f+-%f\n", i, params(i), errors(i));
59 printf(
"chisquare=%f\n", chisquare);
63 for (i=n; i<n*2; i++) {
64 x[0+i*5] = randNum.
Uniform(-10, 10);
65 x[1+i*5] = randNum.
Uniform(-10, 10);
66 x[2+i*5] = randNum.
Uniform(-10, 10);
67 x[3+i*5] = randNum.
Uniform(-10, 10);
68 x[4+i*5] = randNum.
Uniform(-10, 10);
70 y[i] = 4*x[0+i*5] + x[1+i*5] + 2*x[2+i*5] + 3*x[3+i*5] + 0.2*x[4+i*5] + randNum.
Gaus()*e[i];
78 printf(
"\nMore Points:\n");
79 for (
Int_t i=0; i<6; i++)
80 printf(
"par[%d]=%f+-%f\n", i, params(i), errors(i));
82 printf(
"chisquare=%.15f\n", chisquare);
93 printf(
"\nWithout Constant\n");
94 for (
Int_t i=0; i<5; i++)
95 printf(
"par[%d]=%f+-%f\n", i, params(i), errors(i));
97 printf(
"chisquare=%f\n", chisquare);
106 printf(
"\nFixed Constant:\n");
108 printf(
"par[%d]=%f+-%f\n", i, params(i), errors(i));
110 printf(
"chisquare=%.15f\n", chisquare);
virtual void GetErrors(TVectorD &vpar)
Returns parameter errors.
virtual void FixParameter(Int_t ipar)
Fixes paramter #ipar at its current value.
virtual Double_t Gaus(Double_t mean=0, Double_t sigma=1)
Samples a random number from the standard Normal (Gaussian) Distribution with the given mean and sigm...
The Linear Fitter - For fitting functions that are LINEAR IN PARAMETERS.
This is the base class for the ROOT Random number generators.
virtual Double_t GetChisquare()
Get the Chisquare.
virtual Int_t Eval()
Perform the fit and evaluate the parameters Returns 0 if the fit is ok, 1 if there are errors...
virtual void GetParameters(TVectorD &vpar)
Returns parameter values.
you should not use this method at all Int_t Int_t Double_t Double_t Double_t e
virtual 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...
virtual void SetFormula(const char *formula)
Additive parts should be separated by "++".
virtual Double_t Uniform(Double_t x1=1)
Returns a uniform deviate on the interval (0, x1).