11.2.3 Higher moments (skewness and kurtosis)

skew( data)
Compute the skewness of data. The skewness is defined as

$\displaystyle skew = (1/N) \sum ((x_i - \hat\mu)/\hat\sigma)^3$ (11.7)

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 mean and sd.

skew_m_sd( data, mean, sd)
Compute the skewness of the dataset data using the given values of the mean mean and standard deviation varsd

$\displaystyle skew = (1/N) \sum ((x_i - mean)/sd)^3$ (11.8)

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

kurtosis( data)
Compute the kurtosis of data. The kurtosis is defined as

$\displaystyle kurtosis = ((1/N) \sum ((x_i - \hat\mu)/\hat\sigma)^4) - 3$ (11.9)

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

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

$\displaystyle kurtosis = ((1/N) \sum ((x_i - mean)/sd)^4) - 3$ (11.10)

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