lin_error_propagation Interface

public interface lin_error_propagation

Performs linear error (or uncertainties) propagation given the sensitivity coefficients and a covariance matrix. The following formula is applied:

Where:

  • is the response whose uncertainty is to be calculated.
  • is a set of input parameters to propagate their uncertainty to .
  • is the vector of sensitivity coefficients of with respect to the different parameters in .
  • is the covariance matrix of the parameters in .

Syntax

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.

Example

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

Contents


Module Procedures

private pure function lin_error_propagation_sp(sensitivities, matcovar) result(res)

Arguments

Type IntentOptional 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.

Return Value real(kind=sp)

Real number with the error or uncertainty (variance) propagated to the new variable.

private pure function lin_error_propagation_dp(sensitivities, matcovar) result(res)

Arguments

Type IntentOptional 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.

Return Value real(kind=dp)

Real number with the error or uncertainty (variance) propagated to the new variable.

private pure function lin_error_propagation_qp(sensitivities, matcovar) result(res)

Arguments

Type IntentOptional 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.

Return Value real(kind=qp)

Real number with the error or uncertainty (variance) propagated to the new variable.