Probability Distributions and Simulation Basics
10 algorithms in Financial Mathematics, Statistics, and Data Foundations · 10 with asserted arithmetic.
In this family#
-
PMF, PDF, CDF, Survival, and Quantile Functions verified
Reads an empirical sample from
input.valuesand reports where the thresholdinput.xsits inside it, plus the sample quantile at probabilityinput.p.pmfPdfCdfSurvivalAndQuantileFunctions(input) -
Bernoulli and Binomial Distributions verified
Computes the Bernoulli mean and the binomial probability mass and cumulative probability for
ksuccesses innindependent trials with success probabilityp.bernoulliAndBinomialDistributions(input) -
Poisson Distribution and Event Counts verified
Evaluates the Poisson probability of exactly
kevents, the cumulative probability of at mostk, and the distribution's mean and variance, for a rate oflambdaevents per interval.poissonDistributionAndEventCounts(input) -
Uniform Distribution and Random Sampling verified
Draws
sampleCountvalues on the unit interval from a seeded linear congruential generator and reports the draws with their support and realised mean.uniformDistributionAndRandomSampling(input) -
Normal Distribution and Standard Normal verified
Evaluates the normal density and cumulative probability at
input.xfor a distribution with meanmuand standard deviationsigma, and returns the standardised score that mapsxonto the standard normal.normalDistributionAndStandardNormal(input) -
Lognormal Distribution and Positive Quantities verified
Evaluates the lognormal density and cumulative probability at
input.xfor a variable whose logarithm is normal with meanmuand standard deviationsigma, and returns the distribution's median.lognormalDistributionAndPositiveQuantities(input) -
Student-t Distribution and Heavy Tails verified
Evaluates the Student t density at
input.xfordfdegrees of freedom and reports the distribution's variance, which only exists oncedfpasses two.studentTDistributionAndHeavyTails(input) -
Exponential, Gamma, and Weibull Waiting-Time Models verified
Evaluates three waiting-time models at the same point
input.x: the exponential survival function, the gamma density, and the Weibull survival function, all sharingshapeandscale.exponentialGammaAndWeibullWaitingTimeModels(input) -
Mixture Distributions, Multimodality, and Fat Tails verified
Evaluates a weighted mixture of normal components at
input.x, which is how a single series can show more than one mode and fatter tails than any of its parts.mixtureDistributionsMultimodalityAndFatTails(input) -
Random Sampling and Monte Carlo Intuition verified
Estimates the probability
pby counting how many ofsampleCountseeded uniform draws land at or below it, and reports how far that Monte Carlo estimate lands from the known answer.randomSamplingAndMonteCarloIntuition(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:
import { pmfPdfCdfSurvivalAndQuantileFunctions } from "fintech-algorithms/foundations/probability-distributions-and-simulation-basics/pmf-pdf-cdf-survival-and-quantile-functions";
import { bernoulliAndBinomialDistributions } from "fintech-algorithms/foundations/probability-distributions-and-simulation-basics/bernoulli-and-binomial-distributions";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.