I have a straight line fit(see attached plot red line).This is the Average value of my efficiency,
I want to take the error of this fit.
There is only one parameter.
TF1 *fAve_simulation = new TF1(“fAve_simulation”,"",-0.03,0.07);
If there are two parameters what could be the error of that fit?
for (Int_t i = 0; i < fAve_simulation->GetNpar(); i++) std::cout << fAve_simulation->GetParName(i) << " = " << fAve_simulation->GetParameter(i) << " +- " << fAve_simulation->GetParError(i) << "\n"
BTW. Before fitting, try to add:
Thank You Wile_E_Coyote.
Is there a way to draw these error bars in the plot?
fAve_simulation->Draw(" E3 same"); doesn’t work.
There is no direct way to draw “confidence bands” for functions in ROOT.
Can we use covarianceMatrix to calculate the error of 2 parameter fit?
TFitResultPtr r = Efficiency_simulation->Fit(“fAve_simulation”,"","",0.78,0.98);
TMatrixD cov = r->GetCorrelationMatrix();
TMatrixD cor = r->GetCovarianceMatrix();
The above gave me an error.I mean crash…
TFitResultPtr r = Efficiency_simulation->Fit(fAve_simulation, "S", "", 0.78, 0.98);
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.