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

Percentile. More...

Public Member Functions

real(sp) function percentile_0d_sp (arrin, k, mask, mode_in)
 
real(dp) function percentile_0d_dp (arrin, k, mask, mode_in)
 
real(sp) function, dimension(size(k)) percentile_1d_sp (arrin, k, mask, mode_in)
 
real(dp) function, dimension(size(k)) percentile_1d_dp (arrin, k, mask, mode_in)
 

Detailed Description

Percentile.

Returns the value below which a certain percent of array values fall.

If an optinal mask is given, values only on those locations that correspond to true values in the mask are used.

Different definitions can be applied to interpolate the stepwise CDF of the given data.

  1. Inverse empirical CDF (no interpolation, default MATHEMATICA)
  2. Linear interpolation (California method)
  3. Element numbered closest
  4. Linear interpolation (hydrologist method)
  5. Mean-based estimate (Weibull method, default IMSL)
  6. Mode-based estimate
  7. Median-based estimate
  8. normal distribution estimate

See: http://reference.wolfram.com/mathematica/tutorial/BasicStatistics.html

Example

vec = (/ 1.,2.,3.,4.,5.,6.,7.,8.,9.,10. /)
! Returns 10.
out = percentile(vec,95.)
! Returns (10.,8)
out = percentile(vec,(/95.,80./))

See also example in test directory

Parameters
[in]real(sp/dp) :: vec(:)1D-array with input numbers
[in]real(sp/dp) :: k[(:)]Percentage of percentile, can be 1 dimensional
[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.
[in]integer(i4), optional :: mode_inSpecifies the interpolation scheme applied.
Default: Inverse empirical CDF (no interpolation, default Mathematica) mode_in = 1_i4
Return values
real(sp/dp) :: out[(size(k))]k-th percentile of values in input array, can be 1 dimensional corresponding to k
Author
Matthias Cuntz
Date
Mar 2011
Author
Stephan Thober
Date
Dec 2011
  • added 1 dimensional version
Author
Juliane Mai
Date
Jul 2012
  • different interpolation schemes
Authors
Matthias Cuntz, Juliane Mai
Date
Jul 2012
  • uses previous of ksmallest to half execution time

Definition at line 174 of file mo_percentile.f90.

Member Function/Subroutine Documentation

◆ percentile_0d_dp()

real(dp) function mo_percentile::percentile::percentile_0d_dp ( real(dp), dimension(:), intent(in)  arrin,
real(dp), intent(in)  k,
logical, dimension(:), intent(in), optional  mask,
integer(i4), intent(in), optional  mode_in 
)

Definition at line 460 of file mo_percentile.f90.

◆ percentile_0d_sp()

real(sp) function mo_percentile::percentile::percentile_0d_sp ( real(sp), dimension(:), intent(in)  arrin,
real(sp), intent(in)  k,
logical, dimension(:), intent(in), optional  mask,
integer(i4), intent(in), optional  mode_in 
)

Definition at line 571 of file mo_percentile.f90.

◆ percentile_1d_dp()

real(dp) function, dimension(size(k)) mo_percentile::percentile::percentile_1d_dp ( real(dp), dimension(:), intent(in)  arrin,
real(dp), dimension(:), intent(in)  k,
logical, dimension(:), intent(in), optional  mask,
integer(i4), intent(in), optional  mode_in 
)

Definition at line 682 of file mo_percentile.f90.

◆ percentile_1d_sp()

real(sp) function, dimension(size(k)) mo_percentile::percentile::percentile_1d_sp ( real(sp), dimension(:), intent(in)  arrin,
real(sp), dimension(:), intent(in)  k,
logical, dimension(:), intent(in), optional  mask,
integer(i4), intent(in), optional  mode_in 
)

Definition at line 802 of file mo_percentile.f90.


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