Routines to calculate statistical moments, and some utilities
statistical moments
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
real(kind=R8), | public | :: | Kk |
sixth moment |
|||
real(kind=R8), | public | :: | Ku |
kurtosis |
|||
real(kind=R8), | public | :: | Sk |
skewness |
|||
real(kind=R8), | public | :: | Ss |
fifth moment |
|||
real(kind=R8), | public | :: | mu |
mean |
|||
real(kind=R8), | public | :: | si |
standard deviation |
|||
real(kind=R8), | public | :: | va |
variance |
Note
Adapted from the following fortran 77 code algorithm 712, collected algorithms from acm. this work published in transactions on mathematical software, vol. 18, no. 4, december, 1992, pp. 434-435.
The algorithm uses the ratio of uniforms method of a.j. kinderman and j.f. monahan augmented with quadratic bounding curves.
Author:
Generate a random normal deviate using the polar method.
Vector of reals that follow a normal law
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer(kind=I4), | intent(in) | :: | n |
vector size |
||
real(kind=R8), | intent(in), | optional | :: | mu |
distribution mean |
|
real(kind=R8), | intent(in), | optional | :: | sigma |
distribution std |
output vector
Function to calculate the median value of a series.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=R8), | intent(in), | dimension(:) | :: | tab |
series 1D array |
|
logical(kind=I4), | intent(in), | optional, | dimension(:) | :: | mask |
mask |
real(kind=R8), | intent(out) | :: | md |
result: series median value |
Function to calculate the statistical moments of an array with mask, of shape dim. 1 or 2
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=R8), | intent(in), | dimension(..) | :: | tab |
1D or 2D array |
|
logical(kind=I4), | intent(in), | optional, | dimension(..) | :: | mask |
1D or 2D mask |
type(moment_stat), | intent(out) | :: | mx |
moment_stat result |
||
integer(kind=I4), | intent(in) | :: | nb_mom |
number of desired moments |
Function to calculate the statistical moments of a 1D array with mask, see calc_moments
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=R8), | intent(in), | dimension(:) | :: | tab |
1D array |
|
logical(kind=I4), | intent(in), | optional, | dimension(:) | :: | mask |
1D mask |
type(moment_stat), | intent(out) | :: | mx |
moment_stat result |
||
integer(kind=I4), | intent(in) | :: | nb_mom |
number of desired moments |
scramble a vector of reals
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=r8), | intent(inout), | dimension(1:lg) | :: | tab | ||
integer(kind=i4), | intent(in) | :: | lg |