I have the parameters and errors on those parameters for a TF1. I want to draw that TF1 on a histogram with the confidence interval (or error band) of that fit as well.
There is a way to do this (as shown below from the ROOT tutorial on confidence intervals) but this requires a histogram to be fit with a function and then calculating the confidence interval. In my case Iām not fitting a histogram but rather drawing a separate TF1 on top of a histogram. Is there a way to do this?
h->Fit(f, "Q");
h->Draw();
/*Create a histogram to hold the confidence intervals*/
TH1D *hint = new TH1D("hint","Fitted gaussian with .95 conf.band", 100, -3, 3);
(TVirtualFitter::GetFitter())->GetConfidenceIntervals(hint);
For example if I have the following function, how can I draw its confidence interval (or error band)
TF1 * f1 = new TF1(āf1ā, ā[0]+[1]*xā);
f1->SetParameters(0,3);
f1->SetParErrors(1,1);
ROOT Version: Not Provided
Platform: Not Provided
Compiler: Not Provided