Estimate Statistical Uncertainties
Table of Contents
Statistical Uncertainties in the Final Project
In the final project you already have a fitted model and physical quantities extracted from your data. The next step is to attach uncertainties to those results. This chapter focuses on how to estimate and interpret statistical uncertainties within a ROOT based analysis, using the objects you have already created in earlier project steps.
Counting Statistics and Event Yields
The simplest and most common statistical uncertainty in an event based analysis comes from counting how many events satisfy a selection. If your project involves counting signal events in a peak, or events in a signal region after background subtraction, you will usually assume Poisson statistics for the event counts.
For a pure count $N$ of independent events, the statistical uncertainty is
For Poisson counting statistics: $\sigma_N = \sqrt{N}$
In a ROOT analysis you rarely write this formula explicitly for simple counts, because ROOT can compute related uncertainties when you do arithmetic with histograms. However, you should always keep the Poisson rule in mind when you interpret yields, efficiencies, and rates.
When you obtain a signal yield by subtracting background from a total count, for example
$$N_{\text{sig}} = N_{\text{total}} - N_{\text{bkg}},$$
and both $N_{\text{total}}$ and $N_{\text{bkg}}$ are independent Poisson counts, then the variance on $N_{\text{sig}}$ is
$$\sigma_{N_{\text{sig}}}^2 = \sigma_{N_{\text{total}}}^2 + \sigma_{N_{\text{bkg}}}^2 = N_{\text{total}} + N_{\text{bkg}}.$$
ROOT will do this propagation automatically when you combine histograms correctly, provided the histograms carry proper bin error information.
Bin Errors in ROOT Histograms
Your project almost certainly uses histograms to represent distributions and to perform fits. In ROOT each histogram bin has a content and an associated statistical error. For an unweighted histogram that you fill with single events using Fill(x), the default bin error is
$$\sigma_{\text{bin}} = \sqrt{N_{\text{bin}}},$$
which follows directly from Poisson statistics.
When you introduce event weights, or when you will later combine, scale, or divide histograms, you must tell ROOT to track bin sum of weights squared. For 1D histograms this is done with Sumw2():
Call hist->Sumw2(); before filling or scaling a histogram if you use weights or expect to perform error propagation correctly.
Once Sumw2 is enabled, the bin error is computed as
$$\sigma_{\text{bin}} = \sqrt{\sum w_i^2},$$
where $w_i$ are the individual event weights that contributed to that bin.
Within your final project workflow, check that all histograms which you use to derive key numbers and plots have their errors initialized. For example, before looping over events you would typically do:
hSignal->Sumw2();
hBackground->Sumw2();
then fill them in the event loop. Later operations like Add, Scale, and Divide will then propagate uncertainties bin by bin.
Propagating Errors from Fits
In earlier project steps you fitted your distributions to extract parameters such as means, widths, amplitudes, or more physical quantities like lifetimes or cross sections. ROOT stores the best fit values and their statistical uncertainties in the associated TF1 and in the fit result.
If you fit a histogram h with a function f, for example:
h->Fit("gaus", "S");
TF1 *fitFunc = h->GetFunction("gaus");you can access the parameter values and uncertainties with
double A = fitFunc->GetParameter(0);
double A_err = fitFunc->GetParError(0);
In the final project, you may be interested in using the fit parameters to compute a derived quantity. Suppose your model has parameters $p_0, p_1, \dots, p_n$ and you compute a result
$$R = R(p_0, p_1, \dots, p_n).$$
The statistical variance on $R$ (assuming small uncertainties and known covariances) is approximated by standard error propagation:
$$\sigma_R^2 = \sum_{i,j} \frac{\partial R}{\partial p_i} \frac{\partial R}{\partial p_j} \text{Cov}(p_i, p_j).$$
If you use the fit option that returns a TFitResultPtr, ROOT can give you the full covariance matrix:
TFitResultPtr r = h->Fit("gaus", "S");
auto cov = r->GetCovarianceMatrix();You can then either compute the propagated error manually or, when your result is itself another fit parameter or a simple combination like a ratio of two parameters, you may approximate the error assuming weak correlations or using analytic derivatives.
When your final project only needs the uncertainties directly provided by the fit, you can stay with parameter errors and the total chi square from the fit. For example: mean energy and its uncertainty from a Gaussian, or lifetime from an exponential decay fit.
Fit parameter uncertainties reported by ROOT are statistical errors under the assumptions of the fit model and the chosen likelihood. They do not include systematic effects or model misspecification.
Uncertainties from Histogram Operations
Often the final physical quantity in your project is not a single fit parameter but a quantity derived from several histogram operations: additions, subtractions, scaling by efficiencies, and sometimes divisions to form ratios or efficiencies.
ROOT propagates statistical errors through several key histogram methods:
- Addition:
hC->Add(hA, hB, c1, c2)
IfhC = c1 hA + c2 hB, and histograms have independent uncertainties, the bin errors satisfy
$$\sigma_{C}^2 = c_1^2 \sigma_A^2 + c_2^2 \sigma_B^2.$$ - Scaling:
h->Scale(factor)
Each bin content and error are multiplied by the same factor:
$$C' = f C,\quad \sigma' = |f| \sigma.$$ - Division:
hRatio->Divide(hNum, hDen)
For a simple ratio $R = N / D$ with independent variables, the approximate propagated variance is
$$\sigma_R^2 \approx \left(\frac{\sigma_N}{D}\right)^2 + \left(\frac{N \sigma_D}{D^2}\right)^2.$$
In your project you should verify that you create the final histograms via these ROOT calls rather than by manually looping over bins and modifying contents without updating errors. The automatic propagation ensures that the error bars you display and the uncertainties you quote reflect the underlying counting statistics.
Estimating Uncertainties on Efficiencies
Many analyses in the final project context involve efficiencies: ratios of selected events to all events. If $N_{\text{pass}}$ events pass a selection and $N_{\text{tot}}$ events were considered, the efficiency estimate is
$$\hat{\epsilon} = \frac{N_{\text{pass}}}{N_{\text{tot}}}.$$
The binomial variance of this estimator is
$$\sigma_{\hat{\epsilon}}^2 = \frac{\hat{\epsilon} (1 - \hat{\epsilon})}{N_{\text{tot}}}.$$
ROOT has utilities to compute binomial errors when you divide histograms that represent the number of passing and total events per bin. For example, TH1::Divide has an option that treats numerator and denominator as binomial counts instead of simple independent variables. Even if you do not use the binomial option, understanding this formula helps you interpret the precision of your efficiency measurements.
For efficiency $\hat{\epsilon} = N_{\text{pass}} / N_{\text{tot}}$ with binomial statistics:
$\sigma_{\hat{\epsilon}} = \sqrt{\dfrac{\hat{\epsilon}(1 - \hat{\epsilon})}{N_{\text{tot}}}}.$
When your final project asks for an efficiency or acceptance with a quoted uncertainty, you can either use ROOT’s built in binomial treatment when dividing histograms, or compute the binomial error directly from the aggregate counts.
Reporting Statistical Uncertainties on Final Results
By the time you reach this step you should have one or more final numerical results: for example a mean energy, a lifetime, a mass peak position, an efficiency, or a cross section. To report them correctly you must attach the statistical uncertainty that originates from your data sample size.
The general structure is:
- Identify which ROOT object holds the quantity: a histogram bin, a fit parameter, an efficiency histogram, or a number computed from counts.
- Use the appropriate ROOT accessor to obtain the central value and its statistical error, for example
GetBinContentandGetBinError, orGetParameterandGetParError. - If your final quantity is a simple combination of such values, apply analytic error propagation using partial derivatives and the covariance information, or use ROOT’s automatic error propagation through histogram arithmetic when appropriate.
- Present the result using a concise format, for example:
$$m = (125.3 \pm 0.4)\ \text{units (stat.)}.$$
If your analysis also includes systematic uncertainties, clearly separate them from the statistical part. This chapter focuses only on the statistical component that ROOT can derive directly from your data and fits. Systematic uncertainties, such as calibration uncertainties or model choices, must be estimated in additional steps outside the purely statistical machinery provided by ROOT.
In your final project report, every key quantitative conclusion should appear together with its statistical uncertainty and a brief explanation of how that uncertainty was obtained from your ROOT analysis.
Views: 10
KAHIBARO