# Higher moments (skewness and kurtosis)¶

gsl_stats_skew(data)

This function computes the skewness of data, a dataset of length n. The skewness is defined as,

$skew = {1 \over N} \sum {\left( x_i - {\hat{\mu}} \over {\hat{\sigma}} \right)}^3$

where $$x_i$$ are the elements of the dataset data. The skewness measures the asymmetry of the tails of a distribution.

The function computes the mean and estimated standard deviation of data via calls to gsl_stats_mean() and gsl_stats_sd().

gsl_stats_skew_m_sd(data, mean, sd)

This function computes the skewness of the dataset data using the given values of the mean mean and standard deviation sd,

$skew = {1 \over N} \sum {\left( x_i - mean \over sd \right)}^3$

where $$x_i$$ are the elements of the dataset data. The skewness measures the asymmetry of the tails of a distribution.

These functions are useful if you have already computed the mean and standard deviation of data and want to avoid recomputing them.

gsl_stats_kurtosis(data)

This function computes the kurtosis of data. The kurtosis is defined as,

$kurtosis = {1 \over N} \left( \sum {\left(x_i - {\hat{\mu}} \over {\hat{\sigma}} \right)}^4 \right) - 3$

The kurtosis measures how sharply peaked a distribution is, relative to its width. The kurtosis is normalized to zero for a Gaussian distribution.

gsl_stats_kurtosis_m_sd(data, mean, sd)

This function computes the kurtosis of the dataset data using the given values of the mean mean and standard deviation sd,

$kurtosis = {1 \over N} \left( \sum {\left(x_i - mean \over sd \right)}^4 \right) - 3$

This function is useful if you have already computed the mean and standard deviation of data and want to avoid recomputing them.