Documentation › Uncertainties and Analyze Data
Uncertainties and Analyze Data
Uncertainties in the fit
Every uncertainty entered is a standard uncertainty: one standard deviation, the 68% half-width. Not a maximum error, not a 95% interval. The fit uses them as weights: each point enters χ² as (residual/σ)², so a point with half the uncertainty counts four times as much. The uncertainties also set the scale of the reported parameter uncertainties, which is why they must be real estimates and not placeholders.
X uncertainties: effective variance
A least-squares fit measures distance in y only. An uncertainty in x is included by asking how much it would move y: where the curve has slope f′, an error σx in x is equivalent to an error f′·σx in y. The two are combined in quadrature into an effective variance for each point,
σeff,i² = σy,i² + ( f′(xi; p) · σx,i )²
and χ² uses σeff. Because f′ depends on the parameters, the weights are re-evaluated as the fit proceeds (this is ROOT's default for TGraphErrors; the tool does not pass the EX0 option that would ignore x errors). The consequence is that an x uncertainty matters most where the curve is steep and not at all where it is flat. The multivariate fit applies the same rule with one term per input, using numerical derivatives. Pulls in the diagnostics are residuals divided by σeff.
Histograms
Counts have Poisson uncertainty; √N is its large-count approximation. The Poisson-likelihood method uses the exact distribution and needs no uncertainty column; the χ² method assigns √N and omits empty bins. See Data and analysis types.
Analyze Data
Analyze Data holds the session's datasets as three kinds of object: raw data (the measurement columns with their uncertainties and units), fit results (the parameters with their full covariance matrix, linked to the dataset they came from) and calculations. Select any of them in the list to see its table; measurement columns also offer a plot and summary statistics (n, mean, sample standard deviation, standard error), and fit results their covariance and correlation matrices.
Calculations
Calculate quantity or column opens a formula bar: Name = formula = result. Every column, fitted parameter and earlier calculation of the dataset is shown as a chip with a short symbol (the fit's own symbol from the equation editor where there is one, otherwise one derived from the name). Clicking a chip inserts its symbol; typing a symbol that matches one links it; any other symbol is asked about, and can be a number you enter with its own uncertainty and unit. The result updates as you type. Whether the result is a single value or a column follows from the inputs: a formula using only parameters and constants gives a value, one using a column gives one value per row. Calculations can use earlier calculations, and the dependencies are tracked: editing a source marks what depends on it stale, and deleting a source removes its dependent calculations after confirmation, so a number is never silently recomputed from the wrong thing.
How uncertainties propagate
For a result q = g(a, b, …) the uncertainty is propagated to first order,
σq² = Σjk (∂g/∂aj) Vjk (∂g/∂ak)
where V is the covariance matrix of the inputs. The partial derivatives are evaluated numerically by central differences at the input values, with a check that the derivative is stable and that the function is differentiable there (a calculation sitting on the corner of an abs or max is refused). The covariance is assembled from the sources: fitted parameters from one fit carry their full covariance, so a quantity built from two correlated parameters gets the correct, often much smaller, uncertainty rather than the sum in quadrature; measurement rows are independent of one another; separately entered quantities and numbers typed into the formula are assumed independent. If a calculation uses another calculation, the chain is followed back to the original sources, so a shared input is never counted twice. An input without an uncertainty makes the result's uncertainty unspecified rather than zero.
First-order propagation is accurate when the uncertainties are small compared with the scale on which g curves. It is inadequate near a singularity (dividing by a quantity whose uncertainty reaches zero) or for strongly nonlinear functions of large relative uncertainties; in those cases the reported uncertainty is a lower bound and the result should be treated with care.
Units
Each source carries a unit, and the formula bar suggests the result unit from them, chosen for a readable magnitude: a time of 0.0017 s is offered as ms, a length of 530 nm as nm. Any compatible unit can be typed instead and the value is converted; an incompatible one is refused with the unit that would fit. The unit grammar is multiplicative: SI base and derived units (m, kg, s, A, K, mol, cd, Hz, N, Pa, J, W, C, V, Ω, F, H, T, Wb), eV, L, min, h, rad, deg and counts, with the SI prefixes, combined with *, /, parentheses and numerical powers: m/s^2, J/(mol*K), mm^-1. A blank unit means a dimensionless number. Dimensional consistency is checked through the formula, so adding metres to seconds, or taking the exponential of something with dimensions, is reported as an error; angles may be given in rad or deg. Celsius, Fahrenheit and decibels are not supported, because they are not multiplicative. Units on a source describe the numbers as they are; they do not convert the fitted data.
Stale results
A fit result remembers a signature of the data and model it was computed from. Editing the data, the model or the exclusions in Make a Plot marks the fit stale: it is shown as such, and calculations that use its parameters refuse to evaluate until the dataset is refitted. Refitting updates every dependent calculation.