Skip to content

Stats Functions

BinomialCDF

calculates the cumulative distribution function for a binomial distribution at a given point

Syntax:

BinomialCDF(k: float, n: float, p: float) -> float

Examples:

BinomialCDF(5, 10, 0.5) ~= 0.623046875

BinomialPMF

calculates the probability mass function for a binomial distribution at a given point

Syntax:

BinomialPMF(k: float, n: float, p: float) -> float

Examples:

BinomialPMF(5, 10, 0.5) ~= 0.24609375

Erf

returns the error function of x

Syntax:

Erf(x: float) -> float

Examples:

Erf(0) ~= 0
Erf(0.5) ~= 0.5204998778130465
Erf(1) ~= 0.8427007929497149

ErfInv

returns the inverse error function of x

Syntax:

ErfInv(x: float) -> float

Examples:

ErfInv(0) ~= 0
ErfInv(0.5204998778130465) ~= 0.5
ErfInv(0.8427007929497149) ~= 1

ExponentialCDF

calculates the cumulative distribution function for an exponential distribution at a given point

Syntax:

ExponentialCDF(x: float, rate: float) -> float

Examples:

ExponentialCDF(1, 1) ~= 0.6321205588285577

ExponentialPDF

calculates the probability density function for an exponential distribution at a given point

Syntax:

ExponentialPDF(x: float, rate: float) -> float

Examples:

ExponentialPDF(1, 1) ~= 0.36787944117144233

ExponentialQuantile

calculates the inverse cumulative distribution (quantile function) for an exponential distribution at a given probability

Syntax:

ExponentialQuantile(p: float, rate: float) -> float

Examples:

ExponentialQuantile(0.6321205588285577, 1) ~= 1.0

NormalCDF

calculates the cumulative distribution function for a normal distribution at a given point

Syntax:

NormalCDF(x: float, mean: float, stdDev: float) -> float

Examples:

NormalCDF(0.5, 0, 1) ~= 0.6914624612740131

NormalPDF

calculates the probability density function for a normal distribution at a given point

Syntax:

NormalPDF(x: float, mean: float, stdDev: float) -> float

Examples:

NormalPDF(0.5, 0, 1) ~= 0.3520653267642995

NormalQuantile

calculates the inverse cumulative distribution (quantile function) for a normal distribution at a given probability

Syntax:

NormalQuantile(p: float, mean: float, stdDev: float) -> float

Examples:

NormalQuantile(0.975, 0, 1) ~= 1.959963984540054

PoissonCDF

calculates the cumulative distribution function for a poisson distribution at a given point

Syntax:

PoissonCDF(k: float, lambda: float) -> float

Examples:

PoissonCDF(2, 3.0) ~= 0.42319008112684364

PoissonPMF

calculates the probability mass function for a poisson distribution at a given point

Syntax:

PoissonPMF(k: float, lambda: float) -> float

Examples:

PoissonPMF(2, 3.0) ~= 0.22404180765538775

UniformCDF

calculates the cumulative distribution function for a uniform distribution at a given point

Syntax:

UniformCDF(x: float, min: float, max: float) -> float

Examples:

UniformCDF(0.5, 0, 1) ~= 0.5

UniformPDF

calculates the probability density function for a uniform distribution at a given point

Syntax:

UniformPDF(x: float, min: float, max: float) -> float

Examples:

UniformPDF(0.5, 0, 1) ~= 1.0

UniformQuantile

calculates the inverse cumulative distribution (quantile function) for a uniform distribution at a given probability

Syntax:

UniformQuantile(p: float, min: float, max: float) -> float

Examples:

UniformQuantile(0.5, 0, 1) ~= 0.5

WilsonScoreInterval

returns the lower and upper bounds of the confidence interval for a given number of successes and trials.

Syntax:

WilsonScoreInterval(n: int, successes: int, confidence: float) -> {lower: float, upper: float}?

Examples:

WilsonScoreInterval(100, 10, 0.95).lower ~= 0.0607186670154472
WilsonScoreInterval(100, 10, 0.95).upper ~= 0.1603555096110922
WilsonScoreInterval(0, 0, 0.95) = {lower: null, upper: null}