FORCES
FORtran lib for Comp. Env. Sys.
|
Mean absolute deviation test. More...
Public Member Functions | |
logical function, dimension(size(arr)) | mad_sp (arr, z, mask, deriv) |
logical function, dimension(size(arr)) | mad_dp (arr, z, mask, deriv) |
real(dp) function, dimension(size(arr)) | mad_val_dp (arr, z, mask, tout, mval) |
real(sp) function, dimension(size(arr)) | mad_val_sp (arr, z, mask, tout, mval) |
Mean absolute deviation test.
Mean absolute deviation test with optional z-value (default: 7) and mask, and 3 optional variants:
Returns mask with true everywhere except where 0<(median-MAD*z/0.6745)
or >(md+MAD*z/0.6745)
If an optional mask is given, the mad test is only performed on those locations that correspond to true values in the mask.
If tout is given mad returns the array with the enteries exceeding the treshold being set to the threshold. With this setting arrays are accepted.
tout accepts:
With this setting only the variant 0 is available (no argument implemented).
Example
See also example in test directory.
[in] | real(sp/dp) :: vec(:) | 1D-array with input numbers |
[in] | real(sp/dp) :: arr | nD-array with input numbers |
[in] | real(sp/dp), optional :: z | Input is allowed to deviate maximum z standard deviations from the median (default: 7). |
[in] | integer(i4), optional :: deriv | 0: Act on raw input (default: 0) 1: Use first derivatives 2: Use 2nd derivatives |
[in] | logical, optional :: mask(:) | 1D-array of logical values with size(vec). If present, only those locations in vec corresponding to the true values in mask are used. nD-array if tout is used. |
[in] | character(1):: tout | u: Trim only values above mad l: Trim only values below mad b: Trim values below and above mad |
logical or real(sp/dp), dimension(size(arr)) :: out | mask with true everywhere except where input deviates more than z standard deviations from median. If tout five, threshold value is returned. |
d = datin[1:n]-datin[0:n-1]because mean of left and right would give 0 for spikes.
Definition at line 94 of file mo_mad.f90.
logical function, dimension(size(arr)) mo_mad::mad::mad_dp | ( | real(dp), dimension(:), intent(in) | arr, |
real(dp), intent(in), optional | z, | ||
logical, dimension(:), intent(in), optional | mask, | ||
integer(i4), intent(in), optional | deriv | ||
) |
Definition at line 106 of file mo_mad.f90.
logical function, dimension(size(arr)) mo_mad::mad::mad_sp | ( | real(sp), dimension(:), intent(in) | arr, |
real(sp), intent(in), optional | z, | ||
logical, dimension(:), intent(in), optional | mask, | ||
integer(i4), intent(in), optional | deriv | ||
) |
Definition at line 174 of file mo_mad.f90.
real(dp) function, dimension(size(arr)) mo_mad::mad::mad_val_dp | ( | real(dp), dimension(:), intent(in) | arr, |
real(dp), intent(in), optional | z, | ||
logical, dimension(:), intent(in), optional | mask, | ||
character(1) | tout, | ||
real(dp), intent(in), optional | mval | ||
) |
Definition at line 243 of file mo_mad.f90.
real(sp) function, dimension(size(arr)) mo_mad::mad::mad_val_sp | ( | real(sp), dimension(:), intent(in) | arr, |
real(sp), intent(in), optional | z, | ||
logical, dimension(:), intent(in), optional | mask, | ||
character(1) | tout, | ||
real(sp), intent(in), optional | mval | ||
) |
Definition at line 306 of file mo_mad.f90.