gum_monte_carlo — SPC uncertainty op

• Data kinds: table → table

• Call: import fullseye as fs; fs.ledger.gum_monte_carlo(table, u='u', sensitivity='sensitivity', n=200000, seed=0, level=0.95, correlation=None, distribution=None, value=None, power=None) (to call the implementation directly, import spc; spc.gum_monte_carlo(table, u='u', sensitivity='sensitivity', n=200000, seed=0, level=0.95, correlation=None, distribution=None, value=None, power=None); from the registry, opsspc.get("gum_monte_carlo"))

Usage

Monte Carlo propagation of distributions (GUM Supplement 1, JCGM 101) (table).

Draws each input quantity from its distribution to form y = sum_i c_i x_i, and returns from the samples the standard uncertainty and the shortest coverage interval. The default is the normal distribution; passing a column name as *distribution* lets you specify names of the same form as gum_standard_uncertainty (rectangular / triangular / ...) per component (it builds a distribution that has the standard uncertainty, not the half-width).

Passing column names as *value* and *power* runs a power model:

y = sum_i c_i (x_i + e_i)^{p_i}

(e_i is the fluctuation drawn from the distribution. The default x_i = 0 / p_i = 1 = linear.) It is limited to powers because an op in the ledger must be declarative and cannot accept an arbitrary function -- even so, the standard's nonlinear example (a sum of squares) can be expressed with it, and the situations where the propagation law breaks down can be reproduced.

★ This is an independent cross-check of gum_propagate. The propagation law is partial derivatives and variance algebra, this one is random samples -- derivation and implementation are separate, so for a linear model u_mc -> u_c should approach (at a rate of 1/sqrt(n)), and if it does not, one of the two is broken. Correlation is introduced via a Cholesky decomposition, so it takes a path separate from the correlation terms of the propagation law.

★★ For nonlinear models, it is correct that the two disagree. Running the standard's example (comparison loss dY = X1^2 + X2^2, each u = 0.005) at x1 = x2 = 0:

propagation law the sensitivities c_i = 2 x_i are both 0, so u_c = 0, interval [0, 0]

Monte Carlo dy = 50e-6, u = 50e-6, interval [0, 150e-6]

The propagation law answers "zero uncertainty" -- this is not an implementation error but a limit of the method itself: the 1st-order approximation loses information at an extremum. Because such situations exist, the Monte Carlo method of Supplement 1 is needed. At x1 = 0.010 the propagation law's interval [-96, +296]e-6 includes a negative loss (physically impossible), and moving away to x1 = 0.050 brings them close: [1520, 3480] vs [1590, 3543].

★★ For non-normal inputs, the coverage interval does not match k u_c. Adding up rectangular distributions approaches the normal by the central limit theorem, but with only 1 component the half-width of the shortest 95 % interval is 0.95 a (not the edge of the support a -- only 95 % worth of width is needed), and it is narrower than k u = 1.96 a/sqrt(3) = 1.1316 a. The ratio is the closed form 1.959964/(sqrt(3) x 0.95) = 1.1911, measured 1.1914. This is not a defect but a sign that the propagation law discards the shape of the distribution, so both are returned and shown to the reader (at first this 0.95 was assumed to be a, which made the gate wrong).

References (sample data, literature)

• Sample-data catalog (download URLs / licences) — 2-D uses skimage.data (BSD/public domain) plus synthetic images; 3-D lists download URLs for real data sources (Stanford, PDS, …).

• Operator provenance and references — the sources of the research/methods this op family came from.

• The canonical algorithm (author, year) and its uses are named in the family usage guide above.

Runnable examples (verified samples that actually call this op)

• poc_measurement_system_analysis — py -3.11 examples/poc_measurement_system_analysis.py

Ops the type connects to (they accept table as input)

msa_anova_table · msa_gauge_rr · msa_bias_linearity · msa_attribute_agreement · gum_standard_uncertainty · gum_propagate · gum_expanded · gum_validate

Same category (uncertainty)

gum_standard_uncertainty · gum_propagate · gum_expanded · gum_validate


*Provenance: spc.py — SPC operator registry. This per-op note is generated by tools/opdocs.py md (do not hand-edit).*

© 2026 Kazufumi Furuse — Fullseye operator documentation. Licensed under Apache-2.0.