Approximating the Digamma function for small arguments

302 Views Asked by At

There are several ways to approximate the Digamma function $\psi(x)$ that become exact for $x\to\infty$.

The simplest approximation is $$\lim_{x\to\infty}(\psi(x)-\mathrm{ln}(x))=0$$

There are other faster appromixations that involve more corrections terms (see this SE post or Digamma article in Wikipedia).

Are there approximations that become exact for $x\to1$ but deviate with growing $x$ ? The approximation shall become better for $x\to1$ for $x\ge1$ (i.e. approximations for $x<1$ are not of interest).

The aim is to approximate the Digamma function for large values $x\to\infty$ and for small values $x\ge1$. Simpler functions shall be used. Approximations that involve Zeta functions or infinite sums make the problem not simpler.

5

There are 5 best solutions below

0
On BEST ANSWER

The following two formulas for the digamma function $\psi(z)$ both converge very rapidly as $z\to 1$, but formula (2) seems to converge slightly faster than formula (1), and also note formula (2) evaluates exactly correct at $z=1$ for all values of $K$.


$$\psi(z)=\underset{K\to\infty}{\text{lim}}\left(z \sum\limits_{k=1}^K \frac{1}{k (k+z)}-\frac{1}{z}-\gamma\right)\tag{1}$$

$$\psi(z)=\underset{K\to\infty}{\text{lim}}\left(\sum\limits_{k=1}^K\left(\frac{1}{k}-\frac{1}{k+z-1}\right)-\gamma\right)\tag{2}$$


The following figure illustrates formulas (1) and (2) for $\psi(z)$ in orange and green overlaid on the blue reference function $\psi(z)$ where both formulas are evaluated at $K=10$. As mentioned above, formula (2) illustrated in green seems to converge more rapidly than formula (1) illustrated in orange, and formula (2) also evaluates exactly correct at $x=1$ for all values of $K$.


Illustration of formulas (1) and (2)enter image description here

Figure (1): Illustrations of formulas (1) and (2) for $\psi(z)$ evaluated at $K=10$ in orange and green overlaid on blue reference function


Formulas (1) and (2) above are from the Wolfram functions site.


There's also the following limit representation of the digamma function expressed in terms of the gamma function.


$$\psi(z)=\underset{s\to 0}{\text{lim}}\ \Gamma(s)\ \left(1-\frac{\Gamma (z-s)}{\Gamma (z)}\right)\tag{3}$$


For $\Re(z)>0$, the digamma function may also be expressed in terms of the Hypergeometric PFQ function.


$$\psi(z)=(z-1)\, _3F_2(1,1,2-z;2,2;1)-\gamma,\quad\Re(z)>0\tag{4}$$

3
On

The Digamma function is analytic at $1$, with Taylor series

$$ \psi(z) = -\gamma - \sum_{n=1}^\infty \zeta(n+1) (1-z)^n $$

This converges for $|z-1|<1$.

EDIT: $\psi$ is analytic in $\mathbb C$ except for poles at the nonpositive integers. So $\psi(1/z)$ is analytic in the disk of radius $1$ around $1$, and its Taylor series around $1$ converges there. So if this Taylor series is $$\psi(1/z) = \sum_{n=0}^\infty c_n (z-1)^n$$, we can write $$ \psi(x) = \sum_{n=0}^\infty c_n \left(\frac{1}{x}-1\right)^n $$ and use partial sums of this as our approximations. For example, the sum up to $n=6$ is

$$-\gamma -\frac{\pi^{2} \left(\frac{1}{x}-1\right)}{6}+\left(\frac{\pi^{2}}{6}-\zeta \! \left(3\right)\right) \left(\frac{1}{x}-1\right)^{2}+\left(-\frac{\pi^{2}}{6}+2 \zeta \! \left(3\right)-\frac{\pi^{4}}{90}\right) \left(\frac{1}{x}-1\right)^{3}+\left(\frac{\pi^{2}}{6}-3 \zeta \! \left(3\right)+\frac{\pi^{4}}{30}-\zeta \! \left(5\right)\right) \left(\frac{1}{x}-1\right)^{4}+\left(-\frac{\pi^{2}}{6}+4 \zeta \! \left(3\right)-\frac{\pi^{4}}{15}+4 \zeta \! \left(5\right)-\frac{\pi^{6}}{945}\right) \left(\frac{1}{x}-1\right)^{5}+\left(\frac{\pi^{2}}{6}-5 \zeta \! \left(3\right)+\frac{\pi^{4}}{9}-10 \zeta \! \left(5\right)+\frac{\pi^{6}}{189}-\zeta \! \left(7\right)\right) \left(\frac{1}{x}-1\right)^{6} $$ where the error is about $0.0020$ at $x=2$ and $0.0206$ at $x=3$.

1
On

The trivial $$\psi(x)=\sum _{n=0}^\infty \frac{ \psi ^{(n)}(1)}{n!}(x-1)^n \qquad \text{for}\qquad 1\leq x \lt 2$$

Another one was already given by @Robert Israel in his answer.

I suppose that there are a few other.

Edit

For illustration, I give you the solution $x_p$ of the equation $$\psi(x)-\sum _{n=0}^p \frac{ \psi ^{(n)}(1)}{n!}(x-1)^n =0.01$$

$$\left( \begin{array}{cc} p & x_p \\ 10 & 1.69006 \\ 20 & 1.82646 \\ 30 & 1.87968 \\ 40 & 1.90795 \\ 50 & 1.92547 \end{array} \right)$$

3
On

Why not use the Laurent series around $0$? $$\psi^{(0)}(z)=\frac{-1}{z}+\sum_{n=0}^\infty \frac{\psi^{(n)}(1)}{n!}z^n$$

0
On

I do not know of an approximation that can make do without the use of infinite sums, but in practical terms this might be addressable by truncation or precomputation as appropriate. The following approximation that requires only elementary math is from

Peter McCullagh, "A Rapidly Convergent Series for Computing $\psi(z)$ and Its Derivatives", Mathematics of Computation, Vol. 36, No. 153, January 1981, pp. 247-248. (online)

$$\psi (1 + z) = -\gamma + \sum_{r=1}^{\infty} (-1)^{r+1} z^{r} \{c_r + r^{-r} / (z + r) \}, \qquad |z| \lt \infty,$$ where $c_r = \sum_{k=r+1}^{\infty}k^{-r-1}$. The publication provides the first fifteen $c_r$ pre-computed to twenty decimal places. I gave it a quick try in the form of an ad-hoc program and it seems to work quite well. Accuracy is best at $\psi(1)$ and diminishes as the argument increases in magnitude, as desired by the asker.