Expand description
Self-contained quantile / density functions for the theoretical
distributions of stat_qq / stat_qq_band (normal, Student t,
exponential, half-normal).
These must work in every feature configuration — including the minimal,
plotters-free --no-default-features build used by the DuckDB extensions —
so they don’t depend on the optional regression feature’s distribution
library. Accuracy (checked against R in the tests):
qnorm: Wichura’s AS 241 (PPND16), ~1e-16 relative;pt/qt: regularized incomplete beta (Lentz continued fraction) and a safeguarded Newton inversion, ~1e-12;ln_gamma: Lanczos (g = 7, n = 9), ~1e-15.
Functions§
- beta_
inc - Regularized incomplete beta
I_x(a, b). - dbeta
- Beta(a, b): density, lower-tail probability, quantile.
- dgamma
- Gamma(shape, rate): density, lower-tail probability, quantile.
- dlnorm
- LogNormal(meanlog, sdlog): density, lower-tail probability, quantile.
- dnorm
- Standard-normal density.
- dnorm_
ms - Normal(mean, sd): density, lower-tail probability, quantile.
- dt
- Student-t density (R’s
dt(x, df)). - gamma_
inc - Regularized lower incomplete gamma
P(a, x)(series belowa + 1, continued fraction above; Numerical Recipesgammp). - ln_
gamma ln Γ(x)forx > 0(Lanczos approximation, reflection below 0.5).- pbeta
- pgamma
- plnorm
- pnorm
- Standard-normal lower-tail probability
Φ(x)(via the complementary error function, |error| < 1.2e-7). - pnorm_
ms - pt
- Student-t lower-tail probability
P(T ≤ t)(R’spt(t, df)). - qbeta
- qgamma
- qlnorm
- qnorm
- Standard-normal quantile (R’s
qnorm(p)), Wichura’s AS 241. - qnorm_
ms - qt
- Student-t quantile for any
p(R’sqt(p, df)): closed forms fordf = 1, 2, otherwise a bracketed Newton inversion ofpt.