Module 8 · Sampling, Estimation, and Statistical Inference Lesson 77 of 120

Confidence Intervals and Coverage

Interpreting interval uncertainty as repeated coverage.

2:39 clip4:05:23–4:08:03 in the full courseWatch on YouTube

Transcript

15 sentences · select one to jump there

Check your understanding

Does 95% confidence mean the fixed parameter has a 95% posterior probability here?

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.

077-confidence-intervals-and-coverage.ts
Start from GitHub
/**
 * Fintech Math Bootcamp · Lesson 077 of 120
 * Confidence Intervals and Coverage
 * Module 08: Sampling, Estimation, and Statistical Inference
 *
 * Scenario: Interpreting interval uncertainty as repeated coverage
 * Rule:     interval = estimate ± critical × SE
 *
 * Try it:   Does 95% confidence mean the fixed parameter has a 95% posterior probability here?
 *
 * Lesson article: https://thefintechbuilder.com/financial-mathematics-statistics-and-data-foundations/sampling-estimation-and-statistical-inference/confidence-intervals-and-coverage/
 * Free course:    https://courses.thefintechbuilder.com
 * Synthetic teaching example, not financial advice or a production library.
 */

export function lesson077() {
  const estimate=3.2,se=Math.sqrt(.7/5),critical=1.96;
  const result={low:estimate-critical*se,high:estimate+critical*se};
  return result;
}

export const checkedResult = {"low":2.466635152192308,"high":3.9333648478076926};

// Run this file directly: npx tsx lessons/08-sampling-estimation-and-statistical-inference/077-confidence-intervals-and-coverage.ts
if (process.argv[1] && import.meta.url.endsWith(process.argv[1].replace(/\\/g, "/").split("/").pop()!)) {
  console.log(JSON.stringify(lesson077(), null, 2));
}

Your output

Press Run to execute the code in your browser.

Expected output

{
  "low": 2.466635152192308,
  "high": 3.9333648478076926
}

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

Lesson notes

The rule

interval = estimate ± critical × SE