Add support for uncertainty dependencies to D-SI
Add support for uncertainty dependencies to D-SI to support METAS UncLib, see www.metas.ch/unclib.
There three ways to express uncertainties:
Standard uncertainty, expanded uncertainty or coverage interval
This has already be done, see si:expandedUncType
and si:coverageIntervalType
. The drawback is, that there is no way to get correlation between multiple output quantities.
Covariance matrix
The covariance matrix which describes the variance in diagonal and the covariance in the off-diagonal of multiple quantities.
This has already be done, see si:covarianceMatrixType
. Now the correlation between multiple output quantities can be described, but not if they are stored in multiple XML files. E.g.: multiple masses in a mass set and each mass has it's on XML file. Or recalibration of standard after on year. There is correlation to the previous calibration which cannot be described.
Uncertainty dependencies
The sensitivity from the output quantity to each, in the measurement model used, input quantity times the standard uncertainty of each input quantity should be stored in a jacobi
element of a new si:uncDependenciesType
.
An input
element of si:uncDependenciesType
should describe each used input quantity. An input quantity should be described using an unique identifier (e.g.: GUID or UUID) and an optional label.
The standard uncertainty of an output quantity can be computed by summing up the square values of the jacobi
elements and finally taking the square root of it.
The covariance matrix C
of multiple output quantities can be computed using the following matrix equation: C = JxJ'
where J
is the Jacobian matrix. The row index of the Jacobian matrix is used for the different output quantities and the column index is used for the used input quantities. The Jacobian matrix is composed using the jacobi
elements. If two or more output quantities depends on the same input ids then there will be correlation. This will work as well if the multiple output quantities are not stored in the same XML file.
The disadvantages from above, see 1. and 2., will not exist when using uncertainty dependencies.
Editorial note: The following addition is copied from an old Merge request and extends the description of Michael.
The unit of each jacobi
element is the same as the corresponding output quantity.
si:uncComplexDependenciesRealImagType
and si:uncComplexDependenciesMagPhaseType
are used for complex quantities.
Example
Let's assume a right triangle where side a
has a value of 3.0 metre
and a standard uncertainty of 0.3 metre
. The other side b
has a value of 4.0 metre
and a standard uncertainty of 0.4 metre
. The first output quantity, the hypotenuse c
is compute with the equation c = sqrt(a*a + b*b)
and can be represented as XML using uncertainty dependencies:
<si:real>
<si:label>hypotenuse c</si:label>
<si:value>5.0</si:value>
<si:unit>\metre</si:unit>
<si:dependencies>
<si:dependency>
<si:input>
<si:id>58-D7-B7-07-EB-AA-42-07-B3-FB-AE-05-0D-D1-BA-A6</si:id>
<si:label>side a</si:label>
</si:input>
<si:jacobi>0.18</si:jacobi>
</si:dependency>
<si:dependency>
<si:input>
<si:id>2C-3F-D9-0A-A7-4F-48-B5-B7-10-E4-CA-5C-CC-81-D6</si:id>
<si:label>side b</si:label>
</si:input>
<si:jacobi>0.32</si:jacobi>
</si:dependency>
</si:dependencies>
</si:real>
The second output quantity, the area f
is compute with the equation f = a*b/2
and can be represented as XML using uncertainty dependencies:
<si:real>
<si:label>area m</si:label>
<si:value>6.0</si:value>
<si:unit>\metre\tothe{2}</si:unit>
<si:dependencies>
<si:dependency>
<si:input>
<si:id>58-D7-B7-07-EB-AA-42-07-B3-FB-AE-05-0D-D1-BA-A6</si:id>
<si:label>side a</si:label>
</si:input>
<si:jacobi>0.6</si:jacobi>
</si:dependency>
<si:dependency>
<si:input>
<si:id>2C-3F-D9-0A-A7-4F-48-B5-B7-10-E4-CA-5C-CC-81-D6</si:id>
<si:label>side b</si:label>
</si:input>
<si:jacobi>0.6</si:jacobi>
</si:dependency>
</si:dependencies>
</si:real>
Now the two output quantities c
and f
are correlated because both depends on side a
and side b
.
This will close issue #33.