31void DrawSmooth(
Int_t pad,
const char *title,
const char *xt,
const char *yt)
34 TH1F *vFrame =
gPad->DrawFrame(0,-130,60,70);
56 vInput.open(
Form(
"%smotorcycle.dat",dir.
Data()));
59 if (!vInput.good())
break;
68 vC1 =
new TCanvas(
"vC1",
"Smooth Regression",200,10,900,700);
75 DrawSmooth(1,
"Kernel Smoother: bandwidth = 2.0",
"times",
"accel");
79 DrawSmooth(2,
"Kernel Smoother: bandwidth = 5.0",
"",
"");
84 DrawSmooth(3,
"Lowess: f = 2/3",
"",
"");
88 DrawSmooth(4,
"Lowess: f = 0.2",
"",
"");
93 DrawSmooth(5,
"Super Smoother: bass = 0",
"",
"");
97 DrawSmooth(6,
"Super Smoother: bass = 3",
"",
"");
char * Form(const char *fmt,...)
TVirtualPad * cd(Int_t subpadnumber=0)
Set current canvas & pad.
A helper class to smooth TGraph.
TGraph * SmoothKern(TGraph *grin, Option_t *option="normal", Double_t bandwidth=0.5, Int_t nout=100, Double_t *xout=0)
Smooth data with Kernel smoother.
TGraph * SmoothLowess(TGraph *grin, Option_t *option="", Double_t span=0.67, Int_t iter=3, Double_t delta=0)
Smooth data with Lowess smoother.
TGraph * SmoothSuper(TGraph *grin, Option_t *option="", Double_t bass=0, Double_t span=0, Bool_t isPeriodic=kFALSE, Double_t *w=0)
Smooth data with Super smoother.
A Graph is a graphics object made of two arrays X and Y with npoints each.
virtual void Draw(Option_t *chopt="")
Draw this graph with its current attributes.
1-D histogram with a float per channel (see TH1 documentation)}
virtual void SetTitle(const char *title)
See GetStatOverflows for more information.
virtual void SetTitleSize(Float_t size=0.02, Option_t *axis="X")
Set the axis' title size.
virtual void SetXTitle(const char *title)
virtual void SetYTitle(const char *title)
virtual TObject * DrawClone(Option_t *option="") const
Draw a clone of this object in the current selected pad for instance with: gROOT->SetSelectedPad(gPad...
virtual void Divide(Int_t nx=1, Int_t ny=1, Float_t xmargin=0.01, Float_t ymargin=0.01, Int_t color=0)
Automatic pad generation by division.
const char * Data() const
TString & ReplaceAll(const TString &s1, const TString &s2)
TString & Append(const char *cs)