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

`weightedmean()` returns `NaN ± 0`?

Fenyutanchan opened this issue · comments

weightedmean([1 ± 0, 1 ± 0]) returns NaN ± 0, but 1 ± 0 is expected. Could you give me a better solution? Thank you very much.

The explanation of what happens is simple: the weights are proportional to the inverse of the variances, so that 0-errors would result in NaN. I'm not sure what's the best solution, apart from special-casing 0, but also how? Do you have any concrete suggestion of how to address this problem?