Calculates the first 4 moments (mean, variance, skewness, kurtosis) of array elements.
double MathMoments( const double&array, // array with data double&mean, // mean (1st moment) double&variance, // variance (2nd moment) double&skewness, // skewness (3rd moment) double&kurtosis, // kurtosis (4th moment) const int start=0, // initial index const intcount=WHOLE_ARRAY// the number of elements );
[in] Array with data for calculation.
[out] Variable for the mean (1st moment)
[out] Variable for the variance (2nd moment)
[out] Variable for the skewness (3rd moment)
[out] Variable for the kurtosis (4th moment)
[in] Initial index for calculation.
[in] The number of elements for calculation.
Returns true if the moments have been calculated successfully, otherwise false.
Calculation of the kurtosis is performed using the excess kurtosis around the normal distribution (excess kurtosis=kurtosis-3), i.e. the excess kurtosis of a normal distribution is zero.
It is positive if the peak of the distribution around the expected value is sharp, and negative if the peak is flat.