27 for (i=0; i<fraction; i++){
31 y[i]=1 + 2*x[i] + 3*x[i]*x[i] + 4*x[i]*x[i]*x[i] + e[i]*r.
Gaus();
33 for (i=fraction; i<npoints; i++){
37 y[i] = 1 + 2*x[i] + 3*x[i]*x[i] + 4*x[i]*x[i]*x[i] + r.
Landau(10, 5);
43 TF1 *ffit1 =
new TF1(
"ffit1",
"pol3", -5, 5);
44 TF1 *ffit2 =
new TF1(
"ffit2",
"pol3", -5, 5);
47 TCanvas *myc =
new TCanvas(
"myc",
"Linear and robust linear fitting");
52 printf(
"Ordinary least squares:\n");
57 printf(
"Resistant Least trimmed squares fit:\n");
64 grr->
Fit(ffit2,
"+rob=0.75");
67 leg->
AddEntry(ffit1,
"Ordinary least squares",
"l");
68 leg->
AddEntry(ffit2,
"LTS regression",
"l");
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.
This class displays a legend box (TPaveText) containing several legend entries.
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...
virtual void SetMinimum(Double_t minimum=-1111)
Set the minimum of the graph.
virtual void Draw(Option_t *option="")
Draw this legend with its current attributes.
virtual void Draw(Option_t *chopt="")
Draw this graph with its current attributes.
This is the base class for the ROOT Random number generators.
virtual void SetGrid(Int_t valuex=1, Int_t valuey=1)
virtual void SetMaximum(Double_t maximum=-1111)
Set the maximum of the graph.
virtual void SetLineColor(Color_t lcolor)
virtual void SetFillColor(Color_t fcolor)
TLegendEntry * AddEntry(const TObject *obj, const char *label="", Option_t *option="lpf")
Add a new entry to this legend.
ClassImp(TMCParticle) void TMCParticle printf(": p=(%7.3f,%7.3f,%9.3f) ;", fPx, fPy, fPz)
virtual Double_t Uniform(Double_t x1=1)
Returns a uniform deviate on the interval (0, x1).
A TGraphErrors is a TGraph with error bars.
virtual Double_t Landau(Double_t mean=0, Double_t sigma=1)
Generate a random number following a Landau distribution with location parameter mu and scale paramet...