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

Population and Sample Standard Deviation

Returning risk or service spread to the original unit.

2:29 clip2:25:08–2:27:37 in the full courseWatch on YouTube

Transcript

19 sentences · select one to jump there

Check your understanding

Is standard deviation the same as mean absolute deviation?

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.

046-population-and-sample-standard-deviation.ts
Start from GitHub
/**
 * Fintech Math Bootcamp · Lesson 046 of 120
 * Population and Sample Standard Deviation
 * Module 05: Dispersion, Shape, and Robust Statistics
 *
 * Scenario: Returning risk or service spread to the original unit
 * Rule:     standard deviation = √variance
 *
 * Try it:   Is standard deviation the same as mean absolute deviation?
 *
 * Lesson article: https://thefintechbuilder.com/financial-mathematics-statistics-and-data-foundations/dispersion-shape-and-robust-statistics/population-and-sample-standard-deviation/
 * Free course:    https://courses.thefintechbuilder.com
 * Synthetic teaching example, not financial advice or a production library.
 */

export function lesson046() {
  const populationVariance = 8.24, sampleVariance = 10.3;
  const result = {populationSD: Math.sqrt(populationVariance),
    sampleSD: Math.sqrt(sampleVariance)};
  return result;
}

export const checkedResult = {"populationSD":2.870540018881465,"sampleSD":3.2093613071762426};

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

Your output

Press Run to execute the code in your browser.

Expected output

{
  "populationSD": 2.870540018881465,
  "sampleSD": 3.2093613071762426
}

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

Lesson notes

The rule

standard deviation = √variance