fintech-algorithms
Using a coding agent? Give it the skill: npx skills add IslamBaraka90/Fintech-Algorithms-Library What it does →

P-Values, Significance, Type I/II Errors, and Power

Install and import#

bash
npm install fintech-algorithms
ts
import { pValuesSignificanceTypeIIiErrorsAndPower } from "fintech-algorithms/financial-mathematics-statistics-and-data-foundations/sampling-estimation-and-statistical-inference/p-values-significance-type-i-ii-errors-and-power";

Signature#

pValuesSignificanceTypeIIiErrorsAndPower(input)

Worked example#

verified This is the worked example published in the article, replayed by the test suite on every run. The output cannot drift.

Input#

input
{
  "sample": [2, 3, 4, 3, 4],
  "estimates": [3, 3.1, 3.2, 3.3, 3.4],
  "populationMean": 3.2,
  "alpha": 0.05,
  "mseBenchmark": 0.1,
  "nullMean": 3,
  "alternativeMean": 3.5,
  "practicalThreshold": 0.1,
  "comparisons": 5
}

Call#

pValuesSignificanceTypeIIiErrorsAndPower(input)

Returns#

object with 2 fields: pValue, significant

{
  "pValue": 0.5929800980174265,
  "significant": false
}

Diagrams#

P-Values, Significance, Type I/II Errors, and Power — article hero
P-Values, Significance, Type I/II Errors, and Power — calculation ledger
P-Values, Significance, Type I/II Errors, and Power — concept anatomy
P-Values, Significance, Type I/II Errors, and Power — failure boundary
P-Values, Significance, Type I/II Errors, and Power — method map
P-Values, Significance, Type I/II Errors, and Power — scenario contrast

How it works#

This page states the contract — how to call it correctly. The article explains the concept: why it works, and where it breaks.

Read the article →

References#

The rest of the Sampling, Estimation, and Statistical Inference family#