You are a guest. Restricted access. Read more.
Command disabled: recent
SCaVis manual

# Error propagation

Error (or uncertainty) propagation for arbitrary (analytic and non-analytic) functions are supported using several methods:

• Using a Taylor expansion
• Using a Monte Carlo simulation

## Error propagation using P1D

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.

## Error propagation

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.

## Error propagation for complex functions

In this section we describe error propagation for an arbitrary transformation using the Java classes.

You are not full member and have a limited access to this section. One can unlock this part after becoming a full member.

## Uncertainty propagation using a Monte Carlo method

Complex functions are difficult to deal with using the above approach. SCaVis includes Java classes for a Monte Carlo approach which:

• avoids any errors associated with the linearization of the model
• produces a distribution for the uncertain output as well as the mean and standard deviation.

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.

You are not full member and have a limited access to this section. One can unlock this part after becoming a full member.

## Error propagation with arbitrary units

Error propagation using arbitrary units is described in Section unit_measurements.