Performs linear error (or uncertainties) propagation given the sensitivity coefficients and a covariance matrix. The following formula is applied:
Where:
y = lin_error_propagation(s,m)
Where:
s
= vector of rank 1 with real numbers containing the sensitivity coefficients.m
= array of rank 2 containing the covariance matrix.y
= real number of the same kind as s
and m
with the
error or uncertainty propagated to this new variable.The following program calculates the linearly propagated error:
PROGRAM lin_error_propagationExample
USE FU_Statistics, ONLY: lin_error_propagation
IMPLICIT NONE
REAL, DIMENSION(3) :: s = [1., 2., 3.]
REAL, DIMENSION(3,3) :: m = &
RESHAPE((/0.5, 2., 3., 2., 5.4, 6., 3., 6., 3.3/),SHAPE(m))
WRITE(*,*) lin_error_propagation(s, m)
END PROGRAM lin_error_propagationExample
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=sp), | intent(in), | DIMENSION(:) | :: | sensitivities |
Vector of sensitivity coefficients of the new variable with the respect the prior variable. It can have any size and it must have one dimension. |
|
real(kind=sp), | intent(in), | DIMENSION(:,:) | :: | matcovar |
Covariance matrix with the error or uncertainty of the prior variable. Dimensions of sensitivities and matcovar must be in agreement. |
Real number with the error or uncertainty (variance) propagated to the new variable.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=dp), | intent(in), | DIMENSION(:) | :: | sensitivities |
Vector of sensitivity coefficients of the new variable with the respect the prior variable. It can have any size and it must have one dimension. |
|
real(kind=dp), | intent(in), | DIMENSION(:,:) | :: | matcovar |
Covariance matrix with the error or uncertainty of the prior variable. Dimensions of sensitivities and matcovar must be in agreement. |
Real number with the error or uncertainty (variance) propagated to the new variable.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=qp), | intent(in), | DIMENSION(:) | :: | sensitivities |
Vector of sensitivity coefficients of the new variable with the respect the prior variable. It can have any size and it must have one dimension. |
|
real(kind=qp), | intent(in), | DIMENSION(:,:) | :: | matcovar |
Covariance matrix with the error or uncertainty of the prior variable. Dimensions of sensitivities and matcovar must be in agreement. |
Real number with the error or uncertainty (variance) propagated to the new variable.