Skip to main content

Module continuous

Module continuous 

Source
Expand description

Continuous distributions (docs/semantics.md, section 13): densities, CDFs, quantiles and moments, and drawing from them.

Drawing uses its own generator and libm rather than the platform’s math library, so that a seed gives the same numbers everywhere (section 14).

Structs§

Mixture
Moments, CDF and quantiles of a mixture of numbers and continuous distributions, each with its probability.
Rng
xoshiro256++, seeded through SplitMix64.

Enums§

Family
A continuous distribution.
Part
A part of a mixture: a number, or a continuous distribution.

Constants§

Z95
The 95% quantile of the standard normal: an estimate’s 90% interval is this many standard deviations on each side of its centre.

Functions§

beta_cdf
The regularized incomplete beta function I_x(a, b), by its continued fraction (Numerical Recipes, section 6.4).
gamma_cdf
The regularized lower incomplete gamma function P(a, x): its series below a + 1, its continued fraction above (Numerical Recipes, 6.2).
invert
The x in lo..hi where a non-decreasing f reaches p (the smallest such x), by bisection.
ln_beta
ln B(a, b), the logarithm of the beta function. For large arguments, the log gammas it’s made of are huge and nearly cancel, so it’s computed from their Stirling series instead, as R’s lbeta is.
std_normal_cdf
std_normal_quantile
Φ⁻¹(p): a rational approximation (Abramowitz and Stegun 26.2.23, error below 4.5e-4), polished by Newton’s method on the exact CDF.