33 for (
int i = 0; i <
n; ++i) {
34 x[i] =
r.Uniform(0,10);
35 y[i] =
r.Uniform(0,10);
43 for(
int i = 0; i <
n; ++i) {
51 TF3 * f3 =
new TF3(
"f3",
"[0] * sin(x) + [1] * cos(y) + [2] * z",0,10,0,10,0,10);
58 bool ret = fitter.
Fit(data);
66 double prob = res.
Prob();
68 Error(
"exampleFit3D",
"Bad data fit - fit p-value is %f",prob);
70 std::cout <<
"Good fit : p-value = " << prob << std::endl;
74 Error(
"exampleFit3D",
"3D fit failed");
Error("WriteTObject","The current directory (%s) is not associated with a file. The object (%s) has not been written.", GetName(), objname)
Class describing the binned data sets : vectors of x coordinates, y values and optionally error on y ...
class containing the result of the fit and all the related information (fitted parameter values,...
void Print(std::ostream &os, bool covmat=false) const
print the result and optionally covariance matrix and correlations
double Prob() const
p value of the fit (chi2 probability)
Fitter class, entry point for performing all type of fits.
const FitResult & Result() const
get fit result
bool Fit(const Data &data, const Function &func, const ROOT::EExecutionPolicy &executionPolicy=ROOT::EExecutionPolicy::kSequential)
fit a data set using any generic model function If data set is binned a least square fit is performed...
void SetFunction(const IModelFunction &func, bool useGradient=false)
Set the fitted function (model function) from a parametric function interface.
virtual void SetParameters(const Double_t *params)
virtual void SetFitResult(const ROOT::Fit::FitResult &result, const Int_t *indpar=nullptr)
Random number generator class based on the maximally equidistributed combined Tausworthe generator by...
RVec< PromoteType< T > > cos(const RVec< T > &v)
RVec< PromoteType< T > > sin(const RVec< T > &v)
WrappedMultiTF1Templ< double > WrappedMultiTF1