Uncertainty
How Sounio represents and (eventually) propagates measurement uncertainty.
Uncertainty
Scientific code is full of measurements, and measurements are never exact. Sounio treats uncertainty as first-class data instead of something you track in comments or spreadsheets.
What Works Today (Compiler Reality)
The compiler enforces the “no silent unwrap” rule for Knowledge<T> (see Knowledge<T>). That gives you a reliable boundary where epistemic information is intentionally discarded.
Beyond that, full automatic uncertainty propagation depends on how much of the epistemic stdlib you use, and which compiler features/backends are enabled.
In the Spec / Intended Semantics
The intended model follows standard metrology practice (GUM-style propagation for independent inputs):
- For
c = a ± b:u(c) = sqrt(u(a)^2 + u(b)^2)
- For
c = a * borc = a / b(relative form):u_rel(c) = sqrt(u_rel(a)^2 + u_rel(b)^2), whereu_rel(x) = u(x) / x
At the language level, the goal is that operations on Knowledge<T>:
- compute the new point estimate
- propagate uncertainty
- update confidence (when applicable)
- append provenance
Practical Guidance
- Keep values as
Knowledge<T>as long as you can. - When you must cross into “plain data”, use
unwrap(reason)and record why. - For domain code (PK/PD, neuroimaging, etc.), prefer the stdlib modules that already model uncertainty and provenance explicitly.