Skip to main content

Module special

Module special 

Source
Expand description

Special functions behind the inverse-CDF samplers: the standard normal quantile and CDF, ln Γ, and the regularized incomplete beta and gamma functions with their inverses. The node library’s distribution tables (polydat-nodes, sampling::icd) and the comprehension runtime’s named-measure sampling (comprehension_forms.md §10.2 R2) compute from the same bodies, so a normal node and a normal comprehension source agree bit for bit on the same quantile.

Functions§

inv_regularized_beta
Inverse regularized beta via bisection.
inv_regularized_gamma_p
Inverse regularized gamma P via bisection.
ln_gamma
Lanczos approximation of ln(Gamma(x)) for x > 0.
normal_cdf
The standard normal CDF Φ(x), through the regularized lower incomplete gamma function: Φ(x) = ½(1 + sgn(x)·P(½, x²/2)).
probit
Rational approximation of the standard normal quantile function. Abramowitz & Stegun 26.2.23: the absolute error is below 4.5e-4 everywhere in (0, 1). 0 and 1 map to the infinities.
regularized_beta
Regularized incomplete beta function I_x(a, b) via series expansion.
regularized_gamma_p
Regularized lower incomplete gamma function P(a, x) via series.