Skip to main content

Module polygamma

Module polygamma 

Source
Expand description

Polygamma functions, the multivariate log-gamma function, and Bernoulli and Euler numbers (SciPy’s polygamma, multigammaln, bernoulli, euler).

See the book entry Log-domain functions and inverse incomplete integrals.

Functions§

bernoulli
The Bernoulli numbers B₀, …, B_n with B₁ = −1/2 (SciPy’s bernoulli). The odd ones beyond B₁ are zero; the even ones come from B_{2k} = (−1)^{k+1} 2 (2k)! ζ(2k) / (2π)^{2k}, accurate to rounding up to n ≈ 260, where they overflow.
euler
The Euler numbers E₀, …, E_n (SciPy’s euler): the coefficients of sech t = Σ E_n tⁿ/n!, zero for odd n, from E_{2k} = (−1)^k 2 (2k)! (2/π)^{2k+1} β(2k + 1) with Dirichlet’s β(s) = Σ (−1)^j/(2j + 1)^s = 4^{−s} (ζ(s, 1/4) − ζ(s, 3/4)).
multigammaln
The logarithm of the multivariate gamma function, ln Γ_d(a) = d(d−1)/4 · ln π + Σ_{j=1}^{d} ln Γ(a + (1 − j)/2), for a > (d − 1)/2 (SciPy’s multigammaln; it normalises the Wishart density).
polygamma
The polygamma function ψ⁽ⁿ⁾(x), the n-th derivative of the digamma function (SciPy’s polygamma). For n ≥ 1, ψ⁽ⁿ⁾(x) = (−1)ⁿ⁺¹ n! ζ(n + 1, x) with the Hurwitz zeta function; negative non-integer x is first shifted to positive values by ψ⁽ⁿ⁾(x) = ψ⁽ⁿ⁾(x + 1) + (−1)ⁿ⁺¹ n! / xⁿ⁺¹. NaN at the poles x = 0, −1, −2, ….