FUNCTION
Kurtosis
Calculates the kurtosis of a given set of data.
Interface
#include <codecogs/statistics/moments/kurtosis.h>
using namespace Statistics::Moments;
A fundamental task in many statistical analyses is to characterize the location and variability of a data set. A further characterization of the data includes skewness and kurtosis.
Kurtosis is a measure of whether the data are peaked or flat relative to a normal distribution. That is, data sets with high kurtosis tend to have a distinct peak near the mean, decline rather rapidly, and have heavy tails.
Data sets with low kurtosis tend to have a flat top near the mean rather than a sharp peak. A uniform distribution would be the extreme case.
The kurtosis for a standard normal distribution is three. For this reason, excess kurtosis is defined as
where x is the actual population and is the standard deviation. This way the standard normal distribution has a kurtosis of zero. Positive kurtosis indicates a peaked distribution and negative kurtosis indicates a flat distribution.
References
NIST/SEMATECH e-Handbook of Statistical Methods, www.itl.nist.gov/div898/handbook/eda/section3/eda35b.htm
Example 1
#include <codecogs/statistics/moments/kurtosis.h>
#include <iostream>
int main()
{
float x[5] = {3.4 , 7.1 , 1.5 , 8.6 , 4.9};
double kurt = Stats::Moments::kurtosis<float>(5, x);
std::cout << "The population kurtosis is: " << kurt << std::endl;
return 0;
}Output:
The population kurtosis is: -0.928457