Z-Score, Robust Z-Score, and Standardization
Install and import#
npm install fintech-algorithmsimport { 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#
{
"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#
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.
References#
- Measures of Scale — NIST/SEMATECH e-Handbook
- Skewness and Kurtosis — NIST/SEMATECH e-Handbook
- Historical-example decision