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

Dispersion, Shape, and Robust Statistics

10 algorithms in Financial Mathematics, Statistics, and Data Foundations · 10 with asserted arithmetic.

In this family#

  1. Deviation, Absolute Deviation, and Squared Deviation verified

    Centres a numeric series on its arithmetic mean and returns the three per-observation distance forms built from that centring: signed, absolute, and squared.

    deviationAbsoluteDeviationAndSquaredDeviation(input)
  2. Range and Interquartile Range verified

    Measures spread two ways on the same series: the full distance from smallest to largest, and the distance covering the middle half between the first and third quartiles.

    rangeAndInterquartileRange(input)
  3. Mean Absolute Deviation verified

    Averages the absolute distances of the observations from their arithmetic mean, giving a spread figure in the same units as the data and without squaring.

    meanAbsoluteDeviation(input)
  4. Median Absolute Deviation verified

    Takes the median of the absolute distances from the series median, and rescales it by 1.4826 so it lines up with a standard deviation under normality.

    medianAbsoluteDeviation(input)
  5. Population and Sample Variance verified

    Averages the squared deviations from the mean twice over the same series: once dividing by the observation count, once by that count less one.

    populationAndSampleVariance(input)
  6. Population and Sample Standard Deviation verified

    Takes the square root of both the population and the sample variance of one series, returning spread in the same units as the observations.

    populationAndSampleStandardDeviation(input)
  7. Coefficient of Variation and Scale Comparability verified

    Divides the sample standard deviation by the absolute value of the mean, turning spread into a unit-free figure that can be compared across series measured on different scales.

    coefficientOfVariationAndScaleComparability(input)
  8. Z-Score, Robust Z-Score, and Standardization verified

    Standardises every observation twice: once against the mean and sample standard deviation, and once against the median and median absolute deviation scaled by 0.67448975.

    zScoreRobustZScoreAndStandardization(input)
  9. Skewness and Tail Asymmetry verified

    Divides the third central moment by the second raised to the power 1.5, giving the moment coefficient of skewness, and labels which tail is the longer one.

    skewnessAndTailAsymmetry(input)
  10. Kurtosis, Excess Kurtosis, and Tail Weight verified

    Divides the fourth central moment by the square of the second, subtracts 3 to give excess kurtosis, and says whether the tails are heavier or lighter than a normal distribution's.

    kurtosisExcessKurtosisAndTailWeight(input)

What they share#

Every topic here is a record-transform, so once you have called one the rest follow the same shape. Import paths differ only in the final segment:

ts
import { deviationAbsoluteDeviationAndSquaredDeviation } from "fintech-algorithms/foundations/dispersion-shape-and-robust-statistics/deviation-absolute-deviation-and-squared-deviation";
import { rangeAndInterquartileRange } from "fintech-algorithms/foundations/dispersion-shape-and-robust-statistics/range-and-interquartile-range";

Read them in the order above — the sequence is pedagogical, not alphabetical.

Where this sits#

Financial Mathematics, Statistics, and Data Foundations collects 120 algorithms across 12 families. For the concept behind this family rather than the call signatures, see the concept guides.