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, ν). - Unit
StudentT 🔒 - A Student-t with
ν > 2degrees 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_fractioninJet2on 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 everya ≥ ½: 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)forx ≥ ½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, inJet2on both, the same branches asUnitStudentT::upper_tail.