uncertainty
Measurement uncertainty budget after the GUM (JCGM 100): a formula over named quantities with standard uncertainties, optional dof and correlations gives the combined standard uncertainty from numeric sensitivities, Welch-Satterthwaite effective dof, coverage factor from Student's t, expanded uncertainty, a contribution table, and a fixed-seed Monte Carlo cross-check validated as in GUM Supplement 1 (JCGM 101) section 8.
- Field
- Measurement and data
- Version
- 0.1.0
- Runs as
- Compiled (Rust)
- Typical run
- 0.3 s
Compiled from source: run sh packs/install.sh once before admitting it.
Known answers it must pass
r0001sum y = a + b (GUM eq. 10 closed form): u = sqrt(0.3^2 + 0.4^2) = 0.5 exactly, k = normal 97.5 % quantile 1.959963984540054 (textbook), rel 1e-9 (finite-difference sensitivity)passed
y15 ± 1.5e-1115lockedunder 0.01 % of the tolerance usedu_c0.5 ± 5e-100.5locked0.52 % of the tolerance usedk1.95996 ± 2e-091.95996lockedunder 0.01 % of the tolerance usedmc_u0.5 ± 0.00450.499078locked20 % of the tolerance usedmc_agrees= truetruelockedexact matchr0002product y = a b (GUM 5.1.6): relative u adds in quadrature, sqrt(1%^2 + 2%^2) = sqrt(5e-4) = 0.022360679774998, u = 6 x that = 0.134164078649987, rel 1e-9passed
y6 ± 6e-126lockedunder 0.01 % of the tolerance usedu_rel0.0223607 ± 2.2e-110.0223607locked0.1 % of the tolerance usedu_c0.134164 ± 1.3e-100.134164locked0.1 % of the tolerance usedr0003square y = x^2: u = 2 x u_x = 2 * 3 * 0.1 = 0.6 (closed form), rel 1e-9passed
y9 ± 9e-129lockedunder 0.01 % of the tolerance usedu_c0.6 ± 6e-100.6locked0.063 % of the tolerance usedcontributions.x.sensitivity{"value": 6.0, "rel_tol": 1e-09}r0004difference a - b fully correlated (r = 1) with equal u = 0.2: u_c = 0 exactly (GUM eq. 16); abs 1e-9 for finite-difference roundoffpassed
y3 ± 3e-123lockedunder 0.01 % of the tolerance usedu_c0 ± 1e-090lockedunder 0.01 % of the tolerance usedmc_u0 ± 1e-096.15455e-16lockedunder 0.01 % of the tolerance usedr0005cylinder density m/(pi r^2 h): rho = 0.5/(pi 0.02^2 0.05) = 7957.747154594767, u_rel = sqrt(0.002^2 + 4 0.005^2 + 0.004^2) = sqrt(1.2e-4) = 0.010954451150103 (closed form), rel 1e-9passed
y7957.75 ± 8e-097957.75lockedunder 0.01 % of the tolerance usedu_rel0.0109545 ± 1.1e-110.0109545locked0.017 % of the tolerance usedu_c87.1728 ± 8.7e-0887.1728locked0.017 % of the tolerance usedcontributions.r.share_pct{"value": 83.33333333333333, "rel_tol": 1e-09}r0006Welch-Satterthwaite a + b, u = 1 and dof = 1 each: nu_eff = 2^2/(1+1) = 2; k = t(0.975, 2) = 0.95 sqrt(2/0.0975) = 4.302652729749461 (closed form for nu = 2); U = k sqrt 2, rel 1e-9passed
nu_eff2 ± 2e-092lockedunder 0.01 % of the tolerance usedk4.30265 ± 4.3e-094.30265lockedunder 0.01 % of the tolerance usedU6.08487 ± 6.1e-096.08487locked0.12 % of the tolerance usedr0007t quantile nu = 1: one quantity with dof 1 gives k = t(0.975, 1) = tan(0.475 pi) = 12.706204736174696 (Cauchy closed form), rel 1e-9passed
nu_eff1 ± 1e-091lockedunder 0.01 % of the tolerance usedk12.7062 ± 1.3e-0812.7062lockedunder 0.01 % of the tolerance usedu_c1 ± 1e-091locked0.14 % of the tolerance usedr0008Welch-Satterthwaite with unequal terms, y = 2a + b, u_a = sqrt(3)/2 (dof 3), u_b = 1 (dof 1): c u = sqrt 3 and 1, u_c = 2, nu_eff = 16/(9/3 + 1/1) = 4; k = t(0.975, 4) = 2 sqrt(q - 1), q = cos(acos(sqrt A)/3)/sqrt A, A = 4 p (1 - p) (closed form for nu = 4) = 2.7764451051977934; U = 2 k, rel 1e-9passed
u_c2 ± 2e-092locked0.27 % of the tolerance usednu_eff4 ± 4e-094lockedunder 0.01 % of the tolerance usedk2.77645 ± 2.8e-092.77645lockedunder 0.01 % of the tolerance usedU5.55289 ± 5.6e-095.55289locked0.27 % of the tolerance usedr0009truncation of nu_eff (GUM G.6.4) at 99 %: same model with dof_b = 1.8 gives nu_eff = 16/(3 + 1/1.8) = 4.5, used as 4; k = t(0.995, 4) = 4.604094871349992 (same nu = 4 closed form), rel 1e-9passed
nu_eff4.5 ± 4.5e-094.5lockedunder 0.01 % of the tolerance usednu_used4 ± 4e-124lockedunder 0.01 % of the tolerance usedk4.60409 ± 4.6e-094.60409lockedunder 0.01 % of the tolerance usedr0010Monte Carlo y = x^2, x ~ N(1, 0.5): exact E = x^2 + u^2 = 1.25, sd = sqrt(4 x^2 u^2 + 2 u^4) = 1.0606601717798212 (normal moments); GUM gives 1.0 and is not validated; tol 0.012 = about 4.5 sampling errors at 200000 drawspassed
u_c1 ± 1e-091locked0.15 % of the tolerance usedmc_mean1.25 ± 0.0121.25123locked10 % of the tolerance usedmc_u1.06066 ± 0.0121.05958locked9 % of the tolerance usedmc_agrees= falsefalselockedexact match
Each line is one reading the kernel checked. The bright band is the tolerance; the needle is the value the instrument actually returned when it was admitted. A needle near the centre line used little of its tolerance.
Inputs
| Name | Unit | Default | Meaning |
|---|---|---|---|
formula | m/(pi*r^2*h) | The measurement model y = f(x) over the names in quantities. Operators + - * / ^ (or **), parentheses, constants pi and e, functions sqrt exp ln log10 sin cos tan asin acos atan sinh cosh tanh abs pow hypot atan2. Angles in radians. | |
quantities | {"m": {"value": 0.5, "u_rel": 0.002}, "r": {"value": 0.02, "u_rel": 0.005}, "h": {"value": 0.05, "u_rel": 0.004}} | Input quantities by name: {"value": best estimate, "u": standard uncertainty in the value's unit, or "u_rel": standard uncertainty as a fraction of |value|, optional "dof": degrees of freedom (left out = infinite), optional "dist": "normal" (default) or "rectangular" for the Monte Carlo draw}. Each quantity carries its own unit; the formula must be consistent in them. | |
correlations | [] | Correlation coefficients between pairs of quantities: [{"a": name, "b": name, "r": -1 .. 1}]. Pairs left out are uncorrelated. | |
coverage_p | 1 | 0.95 | Coverage probability of the expanded uncertainty and of the Monte Carlo interval. |
mc_samples | 1 | 200000 | Number of Monte Carlo draws. |
seed | 1 | 1 | Seed of the Monte Carlo generator (xoshiro256**); the same seed gives the same draws. |
y_unit | 1 | Unit of the formula's result (written on y, u_c, U and the intervals), e.g. "kg/m^3". "1" for a plain number. |
Readings
| Name | Unit | Meaning |
|---|---|---|
formula | ||
y_unit | ||
y | estimate f(x) at the best estimates | |
u_c | combined standard uncertainty (GUM eq. 13) | |
u_rel | 1 | u_c / |y| |
nu_eff | 1 | Welch-Satterthwaite effective degrees of freedom; null when infinite |
nu_used | 1 | nu_eff truncated to the next lower integer (GUM G.6.4) |
coverage_p | 1 | |
k | 1 | coverage factor: Student's t quantile at nu_used, or the normal quantile |
U | expanded uncertainty k u_c | |
low | ||
high | ||
correlation_share_pct | % | share of u_c^2 from the correlation terms |
contributions | per quantity: value, u, dof, dist, sensitivity (df/dx), rel_sensitivity (x/y df/dx), u_y (|c| u, in y's unit), share_pct (of u_c^2) | |
mc_samples | 1 | |
mc_seed | 1 | |
mc_mean | ||
mc_u | standard deviation of the Monte Carlo output | |
mc_u_se | sampling error of mc_u (from the sample kurtosis) | |
mc_mean_se | ||
mc_low | ||
mc_high | ||
mc_u_rel_diff | 1 | (mc_u - u_c) / u_c |
mc_check_delta | GUM S1 numerical tolerance: half a unit in the 2nd significant digit of u_c | |
mc_check_tol | delta plus three sampling errors of a Monte Carlo endpoint | |
mc_d_low | ||
mc_d_high | ||
mc_nonfinite | 1 | |
mc_agrees | true when both interval endpoints agree within mc_check_tol | |
warnings | ||
contributions.csv | ||
mc_histogram.csv |
Try the call
Change a value and the command updates. Nothing runs here; paste it into your terminal or give it to your agent.