0.6.2-dev0
FORCES
FORtran lib for Comp. Env. Sys.
Loading...
Searching...
No Matches
mo_errormeasures::mae Interface Reference

Mean absolute error. More...

Public Member Functions

real(sp) function mae_sp_1d (x, y, mask)
 
real(dp) function mae_dp_1d (x, y, mask)
 
real(sp) function mae_sp_2d (x, y, mask)
 
real(dp) function mae_dp_2d (x, y, mask)
 
real(sp) function mae_sp_3d (x, y, mask)
 
real(dp) function mae_dp_3d (x, y, mask)
 

Detailed Description

Mean absolute error.

Calculates the mean absolute error,

\[ MAE = \sum_i\frac{|y_i - x_i|}{N_\text{mask}} \]

If an optinal mask is given, the calculations are over those locations that correspond to true values in the mask. \( x\) and \( y\) can be single or double precision. The result will have the same numerical precision.

Example

vec1 = (/ 1., 2, 3., -999., 5., 6. /)
vec2 = (/ 1., 2, 3., -999., 5., 6. /)
m = mae(vec1, vec2, mask=(vec >= 0.))
--> m = 0.0

See also example in test directory.

Parameters
[in]real(sp/dp), dimension() :: x, y1D/2D/3D-array with input numbers.
[in]logical, optional :: mask1D/2D/Array-array of logical values with size(x/y). If present, only those locations in vec corresponding to the true values in mask are used.
Returns
"real(sp/dp) :: MAE" MAE.
Note
Input values must be floating points.
Authors
Matthias Zink
Date
Sept 2012

Definition at line 269 of file mo_errormeasures.f90.

Member Function/Subroutine Documentation

◆ mae_dp_1d()

real(dp) function mo_errormeasures::mae::mae_dp_1d ( real(dp), dimension(:), intent(in)  x,
real(dp), dimension(:), intent(in)  y,
logical, dimension(:), intent(in), optional  mask 
)

Definition at line 1843 of file mo_errormeasures.f90.

◆ mae_dp_2d()

real(dp) function mo_errormeasures::mae::mae_dp_2d ( real(dp), dimension(:, :), intent(in)  x,
real(dp), dimension(:, :), intent(in)  y,
logical, dimension(:, :), intent(in), optional  mask 
)

Definition at line 1909 of file mo_errormeasures.f90.

◆ mae_dp_3d()

real(dp) function mo_errormeasures::mae::mae_dp_3d ( real(dp), dimension(:, :, :), intent(in)  x,
real(dp), dimension(:, :, :), intent(in)  y,
logical, dimension(:, :, :), intent(in), optional  mask 
)

Definition at line 1976 of file mo_errormeasures.f90.

◆ mae_sp_1d()

real(sp) function mo_errormeasures::mae::mae_sp_1d ( real(sp), dimension(:), intent(in)  x,
real(sp), dimension(:), intent(in)  y,
logical, dimension(:), intent(in), optional  mask 
)

Definition at line 1810 of file mo_errormeasures.f90.

◆ mae_sp_2d()

real(sp) function mo_errormeasures::mae::mae_sp_2d ( real(sp), dimension(:, :), intent(in)  x,
real(sp), dimension(:, :), intent(in)  y,
logical, dimension(:, :), intent(in), optional  mask 
)

Definition at line 1876 of file mo_errormeasures.f90.

◆ mae_sp_3d()

real(sp) function mo_errormeasures::mae::mae_sp_3d ( real(sp), dimension(:, :, :), intent(in)  x,
real(sp), dimension(:, :, :), intent(in)  y,
logical, dimension(:, :, :), intent(in), optional  mask 
)

Definition at line 1942 of file mo_errormeasures.f90.


The documentation for this interface was generated from the following file: