Module 7 · Probability Distributions and Simulation Basics Lesson 67 of 120

Student-t Distribution and Heavy Tails

Allowing heavier tails without assuming all moments exist.

2:38 clip3:32:46–3:35:24 in the full courseWatch on YouTube

Transcript

19 sentences · select one to jump there

Check your understanding

Can a finite sample SD prove a t population has finite variance?

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.

067-student-t-distribution-and-heavy-tails.ts
Start from GitHub
/**
 * Fintech Math Bootcamp · Lesson 067 of 120
 * Student-t Distribution and Heavy Tails
 * Module 07: Probability Distributions and Simulation Basics
 *
 * Scenario: Allowing heavier tails without assuming all moments exist
 * Rule:     standard t variance = ν/(ν−2), only for ν>2
 *
 * Try it:   Can a finite sample SD prove a t population has finite variance?
 *
 * Lesson article: https://thefintechbuilder.com/financial-mathematics-statistics-and-data-foundations/probability-distributions-and-simulation-basics/student-t-distribution-and-heavy-tails/
 * Free course:    https://courses.thefintechbuilder.com
 * Synthetic teaching example, not financial advice or a production library.
 */

export function lesson067() {
  const variance=(nu:number):number|null => nu>2 ? nu/(nu-2) : null;
  const result={df3:variance(3),df5:variance(5),df2:variance(2),
    meanExistsAt1:1>1};
  return result;
}

export const checkedResult = {"df3":3,"df5":1.6666666666666667,"df2":null,"meanExistsAt1":false};

// Run this file directly: npx tsx lessons/07-probability-distributions-and-simulation-basics/067-student-t-distribution-and-heavy-tails.ts
if (process.argv[1] && import.meta.url.endsWith(process.argv[1].replace(/\\/g, "/").split("/").pop()!)) {
  console.log(JSON.stringify(lesson067(), null, 2));
}

Your output

Press Run to execute the code in your browser.

Expected output

{
  "df3": 3,
  "df5": 1.6666666666666667,
  "df2": null,
  "meanExistsAt1": false
}

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

Lesson notes

The rule

standard t variance = ν/(ν−2), only for ν>2