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

Effect Size, Practical Significance, and Multiple Comparisons

Install and import#

bash
npm install fintech-algorithms
ts
import { effectSizePracticalSignificanceAndMultipleComparisons } from "fintech-algorithms/foundations/sampling-estimation-and-statistical-inference/effect-size-practical-significance-and-multiple-comparisons";

Signature#

effectSizePracticalSignificanceAndMultipleComparisons(input)

Reports a standardised effect size for the gap between the mean of input.sample and input.nullMean, tests that gap against a practical threshold, and splits alpha across input.comparisons tests Bonferroni-style.

Parameters#

NameTypeNotes
inputD00InputOne record. sample is the observed data, nullMean is the reference value, practicalThreshold is the smallest gap that matters in the caller's units, comparisons is how many tests the error budget is being split across, and alpha is that budget. estimates is validated for the whole family before dispatch.
sample: non-empty list of finite numbers, at least two of them · estimates: non-empty list of finite numbers · alpha: strictly between 0 and 1 · comparisons: integer, 1 or greater

Returns#

D00Output

An object with standardizedEffect (the gap in sample standard deviations), practicallySignificant (true when the raw gap reaches practicalThreshold), bonferroniAlpha (alpha divided by comparisons) and comparisons.

Errors#

  • When sample or estimates is missing, empty, or contains a non-finite number — both are parsed for every topic in the family, whether or not the topic uses them — throws RangeError
  • When sample holds fewer than two observations — throws RangeError
  • When alpha is not strictly between zero and one — throws RangeError
  • When comparisons is not an integer of at least one — throws RangeError

Complexity: time O(n + m), space O(n + m).

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#

effectSizePracticalSignificanceAndMultipleComparisons(input)

Returns#

object with 2 fields: standardizedEffect, practicallySignificant

{
  "standardizedEffect": 0.23904572186687895,
  "practicallySignificant": true
}

Diagrams#

Effect Size, Practical Significance, and Multiple Comparisons — article hero
Effect Size, Practical Significance, and Multiple Comparisons — calculation ledger
Effect Size, Practical Significance, and Multiple Comparisons — concept anatomy
Effect Size, Practical Significance, and Multiple Comparisons — failure boundary
Effect Size, Practical Significance, and Multiple Comparisons — method map
Effect Size, Practical Significance, and Multiple Comparisons — 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#