Module 5 · Dispersion, Shape, and Robust Statistics Lesson 50 of 120

Kurtosis, Excess Kurtosis, and Tail Weight

Interpreting fourth moments without declaring a tail safe.

2:44 clip2:35:27–2:38:12 in the full courseWatch on YouTube

Transcript

20 sentences · select one to jump there

Check your understanding

Does negative sample excess kurtosis certify light future tails?

Choose one answer

Code lab

Run it yourself

The lesson source in 7 languages. Edit it, run TypeScript and Python right here, and compare with the expected output.

050-kurtosis-excess-kurtosis-and-tail-weight.ts
Start from GitHub
/**
 * Fintech Math Bootcamp · Lesson 050 of 120
 * Kurtosis, Excess Kurtosis, and Tail Weight
 * Module 05: Dispersion, Shape, and Robust Statistics
 *
 * Scenario: Interpreting fourth moments without declaring a tail safe
 * Rule:     kurtosis = m₄/m₂²; excess = kurtosis − 3
 *
 * Try it:   Does negative sample excess kurtosis certify light future tails?
 *
 * Lesson article: https://thefintechbuilder.com/financial-mathematics-statistics-and-data-foundations/dispersion-shape-and-robust-statistics/kurtosis-excess-kurtosis-and-tail-weight/
 * Free course:    https://courses.thefintechbuilder.com
 * Synthetic teaching example, not financial advice or a production library.
 */

export function lesson050() {
  const x = [1,2,2,4,9];
  const mean = x.reduce((a,b)=>a+b,0)/x.length;
  const m = (k:number) => x.reduce((s,v)=>s+(v-mean)**k,0)/x.length;
  const kurtosis = m(4)/m(2)**2;
  const result = {kurtosis, excess: kurtosis-3};
  return result;
}

export const checkedResult = {"kurtosis":2.6779621076444537,"excess":-0.32203789235554625};

// Run this file directly: npx tsx lessons/05-dispersion-shape-and-robust-statistics/050-kurtosis-excess-kurtosis-and-tail-weight.ts
if (process.argv[1] && import.meta.url.endsWith(process.argv[1].replace(/\\/g, "/").split("/").pop()!)) {
  console.log(JSON.stringify(lesson050(), null, 2));
}

Your output

Press Run to execute the code in your browser.

Expected output

{
  "kurtosis": 2.6779621076444537,
  "excess": -0.32203789235554625
}

Prefer your own machine? Every file is in the course repository · open it in Codespaces.

Lesson notes

The rule

kurtosis = m₄/m₂²; excess = kurtosis − 3