Probability Distributions (91)

The Float64Array signatures are synchronous. To use worker threads, call computePool.applyKernel(x, workerKernel(name, ...params)). The worker result is equal to the synchronous result bit for bit. See the migration guide.

bernoulliPMF
Bernoulli PMF
Syntax
bernoulliPMF(k, p)
betaCDF
Beta CDF, shape parameters a, b
Syntax
betaCDF(x, a, b)
betaDist
Beta distribution
Syntax
betaDist(alpha, beta)
betaPDF
Beta PDF
Syntax
betaPDF(x, alpha, beta_)
betaQuantile
Beta quantile
Syntax
betaQuantile(p, a, b)
binomialDist
Binomial distribution
Syntax
binomialDist(n, p)
binomialPMF
Binomial PMF
Syntax
binomialPMF(k, n, p)
cauchyCDF
Cauchy CDF
Syntax
cauchyCDF(x[, x0, gamma])
cauchyPDF
Cauchy (Lorentz) PDF — location x0, scale gamma
Syntax
cauchyPDF(x[, x0, gamma])
cauchyQuantile
Cauchy quantile
Syntax
cauchyQuantile(p[, x0, gamma])
chiSquaredCDF
Chi-squared CDF
Syntax
chiSquaredCDF(x, df)
chiSquaredDist
Chi-squared distribution
Syntax
chiSquaredDist(k)
chiSquaredQuantile
Chi-squared quantile
Syntax
chiSquaredQuantile(p, df)
chiSquaredSF
Chi-squared survival P(X > x), computed directly in the tail
Syntax
chiSquaredSF(x, df)
circmean
Circular mean via atan2(Σsinθ, Σcosθ); opts.low/opts.high set the angular range (default [0, 2π))
Syntax
circmean(angles[, opts])
circstd
Circular standard deviation, sqrt(−2·ln R)), R = mean resultant length
Syntax
circstd(angles[, opts])
circvar
Circular variance, 1 − R, R ∈ [0, 1]
Syntax
circvar(angles[, opts])
dirichletPdf
Dirichlet density on the simplex
Syntax
dirichletPdf(x, alpha)
Typesnumber[]
dirichletSample
n Dirichlet draws (default 1) as an n × K array, by gamma normalization; seed makes it reproducible
Syntax
dirichletSample(alpha[, n, { seed }])
Typesnumber[]
discreteUniformDist
Listed in the export index; see the source for details.
Syntax
discreteUniformDist(…)
entropy
Shannon entropy (bits)
Syntax
entropy(probs)
exponentialCDF
Exponential CDF
Syntax
exponentialCDF(x, lambda)
exponentialDist
Exponential distribution
Syntax
exponentialDist([lambda])
exponentialPDF
Exponential PDF
Syntax
exponentialPDF(x, lambda)
fCDF
F-distribution CDF, d1/d2 degrees of freedom
Syntax
fCDF(x, d1, d2)
fDist
F-distribution
Syntax
fDist(d1, d2)
fQuantile
F-distribution quantile
Syntax
fQuantile(p, d1, d2)
fSF
F-distribution survival P(X > x), computed directly in the tail
Syntax
fSF(x, d1, d2)
gammaCDF
Gamma CDF (shape k, rate defaults to 1)
Syntax
gammaCDF(x, shape[, rate])
gammaDist
Gamma distribution
Syntax
gammaDist(shape[, rate])
gammaPDF
Gamma PDF (shape k, rate defaults to 1)
Syntax
gammaPDF(x, shape[, rate])
gammaQuantile
Gamma quantile
Syntax
gammaQuantile(p, shape[, rate])
gaussianKDE
1-D Gaussian kernel density estimation; opts.bandwidth defaults to Silverman's rule of thumb; returns { evaluate, bandwidth } — the library's first nonparametric density estimator
Syntax
gaussianKDE(samples[, opts])
geometricPMF
Geometric PMF
Syntax
geometricPMF(k, p)
gevCDF
Generalized extreme-value distribution; ξ = 0 is the Gumbel limit; outside the support the CDF is 0 or 1 and the PDF is 0
Syntax
gevCDF(x, xi[, mu, sigma])
Typesnumber
gevPDF
Generalized extreme-value distribution; ξ = 0 is the Gumbel limit; outside the support the CDF is 0 or 1 and the PDF is 0
Syntax
gevPDF(x, xi[, mu, sigma])
Typesnumber
gumbelDist
Listed in the export index; see the source for details.
Syntax
gumbelDist(…)
hypergeometricDist
Listed in the export index; see the source for details.
Syntax
hypergeometricDist(…)
inverseGammaCDF
Inverse-gamma with shape α and scale β; CDF is the regularized upper incomplete gamma Q(α, β/x)
Syntax
inverseGammaCDF(x, alpha, beta)
Typesnumber
inverseGammaPDF
Inverse-gamma with shape α and scale β; CDF is the regularized upper incomplete gamma Q(α, β/x)
Syntax
inverseGammaPDF(x, alpha, beta)
Typesnumber
invGaussDist
Listed in the export index; see the source for details.
Syntax
invGaussDist(…)
jsDivergence
Jensen–Shannon divergence
Syntax
jsDivergence(p, q)
kldivergence
Kullback–Leibler divergence (factory layer)
Syntax
kldivergence(p, q)
laplaceCDF
Laplace CDF
Syntax
laplaceCDF(x[, mu, b])
laplacePDF
Laplace (double-exponential) PDF — location mu, scale b
Syntax
laplacePDF(x[, mu, b])
laplaceQuantile
Laplace quantile
Syntax
laplaceQuantile(p[, mu, b])
logisticCDF
Logistic CDF
Syntax
logisticCDF(x[, mu, s])
logisticPDF
Logistic PDF — location mu, scale s
Syntax
logisticPDF(x[, mu, s])
logisticQuantile
Logistic quantile
Syntax
logisticQuantile(p[, mu, s])
logNormalDist
Log-normal distribution
Syntax
logNormalDist([mu, sigma])
multivariateNormal
Listed in the export index; see the source for details.
Syntax
multivariateNormal(…)
nakagamiPDF
Nakagami-m and Rice densities
Syntax
nakagamiPDF(x, m, omega)
Typesnumber
negativeBinomialDist
Listed in the export index; see the source for details.
Syntax
negativeBinomialDist(…)
noncentralChi2CDF
Noncentral chi-squared CDF (Poisson-mixture over chiSquaredCDF); matches scipy.stats.ncx2.cdf
Syntax
noncentralChi2CDF(x, df, nc)
noncentralChi2PDF
Noncentral chi-squared PDF (Poisson-mixture, ncp = λ ≥ 0)
Syntax
noncentralChi2PDF(x, df, ncp)
noncentralFCDF
Noncentral F CDF (Poisson-mixture over fCDF); matches scipy.stats.ncf.cdf
Syntax
noncentralFCDF(x, dfn, dfd, nc)
noncentralTCDF
Noncentral Student-t CDF (Simpson quadrature of the Φ(t·sqrt(V/ν) − δ) mixture); matches scipy.stats.nct.cdf to ~3 digits
Syntax
noncentralTCDF(t, df, nc)
normalCDF
Normal CDF
Syntax
normalCDF(x[, mu, sigma])
normalDist
Normal distribution
Syntax
normalDist([mu, sigma])
normalPDF
Normal PDF
Syntax
normalPDF(x[, mu, sigma])
normalQuantile
Normal quantile (inverse CDF); defaults standard normal
Syntax
normalQuantile(p[, mu, sigma])
owensT
Owen's T function T(h, a) = (1/2π)∫₀ᵃ e^{−h²(1+x²)/2}/(1+x²) dx; T(0, 1) = 1/8
Syntax
owensT(h, a)
Typesnumber
paretoDist
Listed in the export index; see the source for details.
Syntax
paretoDist(…)
pickRandom
Random element(s) from an array
Syntax
pickRandom(array[, n])
poissonDist
Poisson distribution
Syntax
poissonDist(lambda)
poissonPMF
Poisson PMF
Syntax
poissonPMF(k, lambda)
random
Uniform random number
Syntax
random([min, max])
randomInt
Uniform random integer
Syntax
randomInt([min, max])
rayleighDist
Listed in the export index; see the source for details.
Syntax
rayleighDist(…)
ricePDF
Nakagami-m and Rice densities
Syntax
ricePDF(x, nu, sigma)
Typesnumber
seedProbabilityRng
seedProbabilityRng(seed) resets the internal generator shared by random, randomInt, and pickRandom — pass a string/number for a reproducible sequence, or null to re-seed from the clock.
Syntax
seedProbabilityRng(…)
skellamPMF
Skellam PMF (difference of two Poissons) e^{−(μ₁+μ₂)}(μ₁/μ₂)^{k/2} I_{|k|}(2√(μ₁μ₂)); negative k allowed
Syntax
skellamPMF(k, mu1, mu2)
Typesnumber
skewNormalCDF
Skew-normal density 2φ(z)Φ(αz)/scale and CDF Φ(z) − 2T(z, α), z = (x−loc)/scale
Syntax
skewNormalCDF(x, alpha[, loc, scale])
Typesnumber
skewNormalPDF
Skew-normal density 2φ(z)Φ(αz)/scale and CDF Φ(z) − 2T(z, α), z = (x−loc)/scale
Syntax
skewNormalPDF(x, alpha[, loc, scale])
Typesnumber
string
Convert to a string
Syntax
string(x)
studentizedRangeCDF
CDF of the studentized range (k groups, df residual df); matches scipy.stats.studentized_range.cdf
Syntax
studentizedRangeCDF(q, k, df)
studentizedRangeQuantile
Quantile (inverse CDF) via bisection; supplies Tukey HSD critical values
Syntax
studentizedRangeQuantile(p, k, df)
studentTCDF
Student-t CDF, df degrees of freedom
Syntax
studentTCDF(x, df)
studentTPDF
Student-t PDF
Syntax
studentTPDF(x, df)
studentTQuantile
Student-t quantile
Syntax
studentTQuantile(p, df)
studentTTwoSidedP
Two-sided Student-t p-value, computed in the tail as I_{df/(df+t²)}(df/2, 1/2)
Syntax
studentTTwoSidedP(t, df)
tDist
Student's t-distribution
Syntax
tDist(nu)
triangularDist
Listed in the export index; see the source for details.
Syntax
triangularDist(…)
truncatedNormalCDF
Normal truncated to [a, b] (a ≥ b throws RangeError); tail masses are evaluated through erfcx, so far-tail intervals stay accurate instead of cancelling
Syntax
truncatedNormalCDF(x, a, b[, mu, sigma])
Typesnumber
truncatedNormalMean
Normal truncated to [a, b] (a ≥ b throws RangeError); tail masses are evaluated through erfcx, so far-tail intervals stay accurate instead of cancelling
Syntax
truncatedNormalMean(a, b[, mu, sigma])
Typesnumber
truncatedNormalPDF
Normal truncated to [a, b] (a ≥ b throws RangeError); tail masses are evaluated through erfcx, so far-tail intervals stay accurate instead of cancelling
Syntax
truncatedNormalPDF(x, a, b[, mu, sigma])
Typesnumber
uniformDist
Uniform distribution
Syntax
uniformDist([a, b])
vonMisesPDF
Von Mises (circular normal) PDF, exp(κ·cos(θ−μ)) / (2π·I₀(κ))
Syntax
vonMisesPDF(theta, mu, kappa)
weibullDist
Weibull distribution
Syntax
weibullDist(k[, lambda])
wishartSample
n Wishart draws (default 1) as n positive-definite matrices, by the Bartlett decomposition; seed makes it reproducible
Syntax
wishartSample(df, scale[, n, { seed }])
Typesnumber, number[][]
zipfPMF
Truncated Zipf PMF k^{−s} / H_{n,s} on 1..n
Syntax
zipfPMF(k, s, n)
Typesnumber