FitResult::GetConfidenceIntervals correction factor

Hello,

I am using FitResult::GetConfidenceIntervals with normalization turned off as shown below:

fit_result.GetConfidenceIntervals(len(x_vals), 1, 1, x_vals, two_sig_interval, Double(0.95), False)

Looking at the implementation of GetConfidenceIntervals (here, relevant lines also copied below), I worry that the correction factor calculated on line 581 is too big by a factor of itself. My understanding is that the chi2 distribution used here describes the distribution of the square of the number of standard deviations above or below the mean, and I therefore expect that the correction factor should be included in the square root on line 626.

580  // value to go up in chi2 (1: 1 sigma error(CL=0.683) , 4: 2 sigma errors
581  corrFactor = ROOT::Math::chisquared_quantile(cl, 1);
...
626  double r = std::sqrt(r2);
627  ci[ipoint] = r * corrFactor;

For example, I generally expect two-sigma confidence intervals (z=0.955) to be twice the width of one-sigma confidence intervals (z=0.683), but this function gives two-sigma confidence intervals that are four times the width of the one-sigma confidence intervals. Is my intuition off here?

Thank you,
Bryan


ROOT Version: 6.06
Platform: Not Provided
Compiler: Not Provided


Hi,
Yes it is missing a sqrt. The line above:

 corrFactor = ROOT::Math::chisquared_quantile(cl, 1)

should be

corrFactor = sqrt(ROOT::Math::chisquared_quantile(cl, 1))

so it is also in agreement when one normalizes the error and chi2/ndf=1 with large ndf.
I will provide a PR for this. Thank you for reporting this problem !

Lorenzo

Great, thanks for the quick reply! Do you have a suggestion on how best to work around this in the meantime? If I want the two-sigma confidence intervals, I suppose I should just multiply the one-sigma interval values by 2?

Hi,
Yes, I think this is the best way to work around. Just use CL=0.683 and use afterwards the correct scaling factor. Apologies for this

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.