KURTOSIS

Overview

The KURTOSIS function computes the kurtosis of a dataset, a statistical measure that quantifies the degree of “tailedness” in a probability distribution. Derived from the Greek word kyrtos meaning “curved,” kurtosis describes how extreme the outliers are in a distribution compared to a normal distribution.

This implementation uses the SciPy library’s scipy.stats.kurtosis function. Kurtosis is calculated as the fourth central moment divided by the square of the variance:

\text{Kurt}[X] = \frac{E[(X - \mu)^4]}{(E[(X - \mu)^2])^2} = \frac{\mu_4}{\sigma^4}

where \mu_4 is the fourth central moment and \sigma is the standard deviation.

The function supports two definitions of kurtosis. Fisher’s definition (the default) subtracts 3 from the result, producing what is known as excess kurtosis, where a normal distribution has a value of 0. Pearson’s definition returns the raw fourth standardized moment, where a normal distribution equals 3.

Distributions are categorized by their excess kurtosis:

  • Mesokurtic (excess kurtosis ≈ 0): Similar tail behavior to the normal distribution
  • Leptokurtic (excess kurtosis > 0): Heavier tails with more extreme outliers (e.g., Laplace, Student’s t-distribution)
  • Platykurtic (excess kurtosis < 0): Lighter tails with fewer extreme outliers (e.g., uniform distribution)

Contrary to common misconception, kurtosis measures tail extremity rather than “peakedness” of a distribution. Higher kurtosis indicates a greater tendency to produce outliers, not a sharper peak. The bias parameter allows correction for statistical bias when estimating population kurtosis from sample data. For more details on the statistical theory, see the Wikipedia article on kurtosis.

This example function is provided as-is without any representation of accuracy.

Excel Usage

=KURTOSIS(data, fisher, bias)
  • data (list[list], required): 2D array of numeric values. Non-numeric values are ignored.
  • fisher (bool, optional, default: true): If True, Fisher’s definition is used (normal ==> 0.0). If False, Pearson’s definition is used (normal ==> 3.0).
  • bias (bool, optional, default: true): If False, calculations are corrected for statistical bias.

Returns (float): Kurtosis of the data, or error message (str) if input is invalid.

Examples

Example 1: Fisher kurtosis with bias (default)

Inputs:

data
1
2
3
4

Excel formula:

=KURTOSIS({1;2;3;4})

Expected output:

-1.36

Example 2: Pearson kurtosis with bias

Inputs:

data fisher
1 false
2
3
4

Excel formula:

=KURTOSIS({1;2;3;4}, FALSE)

Expected output:

1.64

Example 3: Fisher kurtosis with bias correction

Inputs:

data fisher bias
1 true false
2
3
4

Excel formula:

=KURTOSIS({1;2;3;4}, TRUE, FALSE)

Expected output:

-1.2

Example 4: Pearson kurtosis with bias correction

Inputs:

data fisher bias
1 false false
2
3
4

Excel formula:

=KURTOSIS({1;2;3;4}, FALSE, FALSE)

Expected output:

1.8

Python Code

from scipy.stats import kurtosis as scipy_kurtosis

def kurtosis(data, fisher=True, bias=True):
    """
    Compute the kurtosis (Fisher or Pearson) of a dataset.

    See: https://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.kurtosis.html

    This example function is provided as-is without any representation of accuracy.

    Args:
        data (list[list]): 2D array of numeric values. Non-numeric values are ignored.
        fisher (bool, optional): If True, Fisher's definition is used (normal ==> 0.0). If False, Pearson's definition is used (normal ==> 3.0). Default is True.
        bias (bool, optional): If False, calculations are corrected for statistical bias. Default is True.

    Returns:
        float: Kurtosis of the data, or error message (str) if input is invalid.
    """
    def to2d(x):
        return [[x]] if not isinstance(x, list) else x

    data = to2d(data)

    if not isinstance(data, list) or not all(isinstance(row, list) for row in data):
        return "Invalid input: data must be a 2D list."

    if not isinstance(fisher, bool):
        return "Invalid input: fisher must be a boolean."

    if not isinstance(bias, bool):
        return "Invalid input: bias must be a boolean."

    flat = []
    for row in data:
        for x in row:
            try:
                val = float(x)
                flat.append(val)
            except (TypeError, ValueError):
                continue

    if len(flat) < 2:
        return "Invalid input: data must contain at least two numeric values."

    result = scipy_kurtosis(flat, fisher=fisher, bias=bias, nan_policy='omit')
    return float(result)

Online Calculator