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). - dnorm
- Standard-normal density.
- dt
- Student-t density (R’s
dt(x, df)). - ln_
gamma ln Γ(x)forx > 0(Lanczos approximation, reflection below 0.5).- pt
- Student-t lower-tail probability
P(T ≤ t)(R’spt(t, df)). - qnorm
- Standard-normal quantile (R’s
qnorm(p)), Wichura’s AS 241. - qt
- Student-t quantile for any
p(R’sqt(p, df)): closed forms fordf = 1, 2, otherwise a bracketed Newton inversion ofpt.