Skip to content

Algorithms | latest | kurtosis

Kurtosis

Kurtosis is a statistical measure that describes the shape of the probability distribution of a dataset, specifically focusing on the tails of the distribution. It quantifies how much a dataset's distribution deviates from the normal distribution (also known as the Gaussian distribution or bell curve). In essence, kurtosis provides information about the tailedness or the presence of outliers in the data.

The kurtosis is computed using the fourth central moment:

Kurtosis=m4m22mk=1Ni=0N1(x[i]x)kx=1Ni=0N1x[i]

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