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);
75 pt->AddText(
"Fitting x^power ");
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);
int Int_t
Signed integer 4 bytes (int).
double Double_t
Double 8 bytes.
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 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 SetParameter(Int_t param, Double_t value)
virtual void Add(TGraph *graph, Option_t *chopt="")
void Draw(Option_t *chopt="") override
Default Draw method for all objects.
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)
Returns x raised to the power y.