JuliaPhysics / Measurements.jl

Error propagation calculator and library for physical measurements. It supports real and complex numbers with uncertainty, arbitrary precision calculations, operations with arrays, and numerical integration.

Home Page:https://juliaphysics.github.io/Measurements.jl/stable/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Distinguishing between statistical and systematic errors in Measurements.jl

barrettp opened this issue · comments

Measurements.jl implicitly assumes that all errors are statistical errors. In most cases this is correct. However, there are cases when the total error is a combination of statistical and systematic error. This is a request to allow for such a distinction in Measurements.jl. So, when a measurement is displayed, it can contain both statistical and systematic errors.

There's a small little-known trick you can already use right now to achieve what you want: create a Measurement{Measurement}} object

julia> x = ((5 ± 0.1) ± 0.2)
5.0 ± 0.1 ± 0.2 ± 0.0

julia> y = ((10 ± 0.2) ± 0.3)
10.0 ± 0.2 ± 0.3 ± 0.0

julia> x + y
15.0 ± 0.22 ± 0.36 ± 0.0

The "problem" is that you have "3 errors", you have to always discard the last one, but the first two are propagated independently, which I believe is what you want.