Error (or uncertainty) propagation for arbitrary (analytic and non-analytic) functions are supported using several methods:
A typical measurement contains an uncertainty. A convenient way to keep data with
errors is to use the
jhplot.P1D data container.
from jhplot import * p=P1D("data with errors") p.add(1, 2, 0.5) # error on Y=2 is 0.5 p.add(2, 5, 0.9) # error on Y=5 is 0.9
See the discussion of P1D in data_structures. When you are using the method “oper()” of this class, the errors are automatically propagated. This applies for subtraction, division, multiplication and addition.
SCaVis links the Python package uncertainties, therefore, you can program with Python as usual. Run this example in the SCaVis IDE and you can see this:
from uncertainties import ufloat from uncertainties.umath import * # sin(), etc. x = ufloat(1, 0.1) # x = 1+/-0.1
This approach calculates errors using a Taylor expansion. It also can differentiate a function.
In this section we describe error propagation for an arbitrary transformation using the Java classes.
Complex functions are difficult to deal with using the above approach. SCaVis includes Java classes for a Monte Carlo approach which:
Propagation of errors formula requires the computation of derivatives, which can be quite complicated for larger models. The Monte Carlo approach can handle correlated parameters as well as independent parameters.
Error propagation using arbitrary units is described in Section unit_measurements.