23 for (
Int_t i = 0; i <
n; i++) {
35 TF1 *f_known=
new TF1(
"f_known",
"pow(x,3)",0,1);
46 r<<
"ds<-data.frame(x=x,y=y)";
48 r<<
"m <- nls(y ~ I(x^power),data = ds, start = list(power = 1),trace = T)";
51 r[
"summary(m)$coefficients[1]"]>>power;
53 TF1 *f_fitted=
new TF1(
"f_fitted",
"pow(x,[0])",0,1);
68 pt->
AddText(
"Fitting x^power ");
69 pt->
AddText(
" \"Blue\" Points with gaussian noise to be fitted");
70 pt->
AddText(
" \"Red\" Known function x^3");
72 fmsg.
Form(
" \"Green\" Fitted function with power=%.4lf",power);
virtual void Draw(Option_t *option="")
Draw this pavetext with its current attributes.
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...
A TMultiGraph is a collection of TGraph (or derived) objects.
virtual TText * AddText(Double_t x1, Double_t y1, const char *label)
Add a new Text line to this pavetext at given coordinates.
virtual void SetSeed(UInt_t seed=0)
Set the random generator seed.
LongDouble_t Power(LongDouble_t x, LongDouble_t y)
This is the base class for the ROOT Random number generators.
virtual void SetGrid(Int_t valuex=1, Int_t valuey=1)
virtual void SetMarkerColor(Color_t mcolor=1)
TCanvas * SimpleFitting()
virtual void Draw(Option_t *chopt="")
Draw this multigraph with its current attributes.
TVectorT< Double_t > TVectorD
virtual void SetTextAlign(Short_t align=11)
virtual void SetFillColor(Color_t fcolor)
void Form(const char *fmt,...)
Formats a string using a printf style format descriptor.
virtual void SetMarkerStyle(Style_t mstyle=1)
virtual void SetMarkerSize(Size_t msize=1)
static const double x1[5]
A Pave (see TPave) with text, lines or/and boxes inside.
static TRInterface & Instance()
static method to get an TRInterface instance reference
virtual Double_t Uniform(Double_t x1=1)
Returns a uniform deviate on the interval (0, x1).
A Graph is a graphics object made of two arrays X and Y with npoints each.
virtual void SetParameter(Int_t param, Double_t value)
virtual void Add(TGraph *graph, Option_t *chopt="")
Add a new graph to the list of graphs.
virtual void Update()
Update canvas pad buffers.