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

Z-Score, Robust Z-Score, and Standardization

Install and import#

bash
npm install fintech-algorithms
ts
import { zScoreRobustZScoreAndStandardization } from "fintech-algorithms/financial-mathematics-statistics-and-data-foundations/dispersion-shape-and-robust-statistics/z-score-robust-z-score-and-standardization";

Signature#

zScoreRobustZScoreAndStandardization(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
{
  "values": [1, 2, 2, 4, 9]
}

Call#

zScoreRobustZScoreAndStandardization(input)

Returns#

object with 2 fields: zScores, robustZScores

{
  "zScores": [
    -0.8101300387046826,
    -0.4985415622798047,
    -0.4985415622798047,
    0.12463539056995114,
    1.6825777726943407
  ],
  "robustZScores": [-0.67448975, 0, 0, 1.3489795, 4.72142825]
}

Diagrams#

Z-Score, Robust Z-Score, and Standardization — article hero
Z-Score, Robust Z-Score, and Standardization — calculation ledger
Z-Score, Robust Z-Score, and Standardization — concept anatomy
Z-Score, Robust Z-Score, and Standardization — failure boundary
Z-Score, Robust Z-Score, and Standardization — method map
Z-Score, Robust Z-Score, and Standardization — 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 Dispersion, Shape, and Robust Statistics family#