From the python uncertainties package:
Correlations between expressions are correctly taken into account. Thus, x-x is exactly zero, for instance (most implementations found on the web yield a non-zero uncertainty for x-x, which is incorrect).
x is a single value, with an uncertainty. What does correlation mean in this context?
Example code to illustrate what it's talking about:
In [1]: from uncertainties import ufloat, umath
In [2]: x = ufloat(2,1)
In [3]: x
Out[3]: 2.0+/-1.0
In [4]: y = ufloat(2,1)
In [5]: y
Out[5]: 2.0+/-1.0
In [6]: z = umath.log(umath.exp(x))
In [7]: z
Out[7]: 2.0+/-1.0
In [8]: x-y
Out[8]: 0.0+/-1.4142135623730951
In [9]: x-z
Out[9]: 0.0+/-0
In this example, x
, y
, and z
are all single values with an uncertainty. I don't understand how two single values can be "correlated".
In a practical sense, I'd also be interested to know how uncertainties
actually keeps track of this "correlation".
Further, why doesn't this include some of the uncorrelated error between x and z?
In [10]: b=x+y
In [11]: c=y+z
In [12]: b-c
Out[12]: 0.0+/-0