30 for (
Int_t i = 0; i <
n; i++) {
42 TF1 *f_known=
new TF1(
"f_known",
"pow(x,3)",0,1);
53 r<<
"ds<-data.frame(x=x,y=y)";
55 r<<
"m <- nls(y ~ I(x^power),data = ds, start = list(power = 1),trace = T)";
58 r[
"summary(m)$coefficients[1]"]>>power;
60 TF1 *f_fitted=
new TF1(
"f_fitted",
"pow(x,[0])",0,1);
76 pt->
AddText(
" \"Blue\" Points with gaussian noise to be fitted");
77 pt->
AddText(
" \"Red\" Known function x^3");
79 fmsg.
Form(
" \"Green\" Fitted function with power=%.4lf",power);
static const double x1[5]
TVectorT< Double_t > TVectorD
ROOT R was implemented using the R Project library and the modules Rcpp and RInside
static TRInterface & Instance()
static method to get an TRInterface instance reference
virtual void SetFillColor(Color_t fcolor)
Set the fill area color.
virtual void SetMarkerColor(Color_t mcolor=1)
Set the marker color.
virtual void SetMarkerStyle(Style_t mstyle=1)
Set the marker style.
virtual void SetMarkerSize(Size_t msize=1)
Set the marker size.
virtual void SetTextAlign(Short_t align=11)
Set the text alignment.
virtual void SetParameter(Int_t param, Double_t value)
A TGraph is an object made of two arrays X and Y with npoints each.
A TMultiGraph is a collection of TGraph (or derived) objects.
virtual void Add(TGraph *graph, Option_t *chopt="")
Add a new graph to the list of graphs.
virtual void Draw(Option_t *chopt="")
Draw this multigraph with its current attributes.
A Pave (see TPave) with text, lines or/and boxes inside.
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 Draw(Option_t *option="")
Draw this pavetext with its current attributes.
This is the base class for the ROOT Random number generators.
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 SetSeed(ULong_t seed=0)
Set the random generator seed.
virtual Double_t Uniform(Double_t x1=1)
Returns a uniform deviate on the interval (0, x1).
void Form(const char *fmt,...)
Formats a string using a printf style format descriptor.
LongDouble_t Power(LongDouble_t x, LongDouble_t y)