Skip to main content

Module student_t

Module student_t 

Expand description

The Student-t distribution scaled to unit variance, for the double-t copula: Z = s·T_ν, s = √((ν − 2)/ν), ν > 2.

The CDF is evaluated passively through the regularised incomplete beta function, P(T > t) = ½·I_{ν/(ν+t²)}(ν/2, ½) for t > 0, by its continued fraction; the normalising constant uses a Stirling form of ln Γ(a + ½) − ln Γ(a) that does not cancel at large a, so ν = 10⁶ reads as accurately as ν = 4. The CDF and the quantile then cross into the AD mode by their Taylor series about the passive point, to third order — the value is the passive one and every derivative up to the third is the function’s own (the density and its two derivatives are closed form). The density is written in the mode directly.

Structs§

NuLift 🔒
The ν-derivatives of a unit-variance t at its passive point, for lifting its CDF, density and quantile jointly in (z, ν).
UnitStudentT 🔒
A Student-t with ν > 2 degrees of freedom, scaled to unit variance.

Functions§

beta_continued_fraction 🔒
The continued fraction of the regularised incomplete beta function (modified Lentz), converging for x < (a + 1)/(a + b + 2).
beta_continued_fraction_jet 🔒
beta_continued_fraction in Jet2 on its parameters: the termwise derivative of the fraction converges to the incomplete beta’s (Boik & Robison-Cox 1998), and the loop runs until the value and both derivative components of each factor have settled.
ln_gamma_half_ratio 🔒
ln Γ(a + ½) − ln Γ(a), stable at every a ≥ ½: a Lanczos difference below 20, above it the Stirling series written so the leading terms do not cancel, ½·ln a + a·ln(1 + 1/(2a)) − ½ + S(a + ½) − S(a), S(z) = 1/(12z) − 1/(360z³) + 1/(1260z⁵) − 1/(1680z⁷).
ln_gamma_half_ratio_in 🔒
ln_gamma_half_ratio’s body, written once against the mode.
ln_gamma_in 🔒
ln Γ(x) for x ≥ ½ by Lanczos’ approximation (g = 7, nine terms), written once against the mode: passively accurate to ~1e-15, and its derivatives are the approximant’s, digamma and trigamma to ~1e-13.
upper_tail_jet 🔒
P(T > t) for the standard t with ν degrees of freedom, in Jet2 on both, the same branches as UnitStudentT::upper_tail.