FORCES
FORtran lib for Comp. Env. Sys.
|
Kurtosis of a vector. More...
Public Member Functions | |
real(sp) function | kurtosis_sp (dat, mask) |
real(dp) function | kurtosis_dp (dat, mask) |
Kurtosis of a vector.
Calculates the kurtosis of a vector, also called excess kurtosis:
\[ Kurt(x) = \verb|central_moment(x,4) / variance(x)**2 - 3| = \sum_i\frac{1}{N}\left(\frac{(x_i-\bar x)^2}{\mu_2(x)}\right)^2 - 3\]
If an optional mask is given, the average is only over those locations that correspond to true values in the mask. \(x\) can be single or double precision. The result will have the same numerical precision.
Example
vec = (/ 1., 2, 3., -999., 5., 6. /) m = kurtosis(vec, mask=(vec >= 0.))
See also example in test directory.
[in] | real(sp/dp) :: dat(:) | 1D-array with input numbers. |
[in] | logical, optional :: mask(:) | 1D-array of logical values with size(dat) . If present, only those locations in dat corresponding to the true values in mask are used. |
real(sp/dp) :: kurtosis | Kurtosis of all elements in dat. |
Definition at line 318 of file mo_moment.f90.
real(dp) function mo_moment::kurtosis::kurtosis_dp | ( | real(dp), dimension(:), intent(in) | dat, |
logical, dimension(:), intent(in), optional | mask | ||
) |
Definition at line 1026 of file mo_moment.f90.
real(sp) function mo_moment::kurtosis::kurtosis_sp | ( | real(sp), dimension(:), intent(in) | dat, |
logical, dimension(:), intent(in), optional | mask | ||
) |
Definition at line 1067 of file mo_moment.f90.