Skip to content

Kurtosis

Kurtosis is a statistical measure that describes the shape of a dataset's probability distribution, with a specific focus on the distribution's tails. It quantifies the degree to which the dataset's distribution differs from the normal distribution (Gaussian distribution or bell curve). Essentially, kurtosis indicates the tailedness of the distribution, highlighting the presence and extremity of outliers.

  • High kurtosis: Indicates heavy tails, meaning more extreme outliers than the normal distribution.
  • Low kurtosis: Indicates light tails, with fewer extreme outliers.
  • Normal kurtosis: A kurtosis of 3 corresponds to a normal distribution.

The kurtosis is calculated using the fourth and second central moment:

Kurtosis=m4m22

where:

  • mk is the k-th central moment:

    mk=1Ni=0N1(x[i]x)k,

    with k=4 for kurtosis and k=2 for variance.

  • x is the mean of the dataset:

    x=1Ni=0N1x[i].
  • N is the number of data points in the dataset.

References

Code

INFO

The following snippet is written in a generic and unoptimized manner. The code aims to be comprehensible to programmers familiar with various programming languages and may not represent the most efficient or idiomatic Python practices. Please refer to implementations for optimized implementations in different programming languages.

py
import numpy as np


def kurtosis(signal: np.ndarray) -> float:
    def central_moment(order: int):
        return np.mean((signal - signal.mean()) ** order)

    return central_moment(4) / central_moment(2) ** 2

Run in playground