psi#

Purpose#

Computes the Psi (or Digamma) function.

Format#

f = psi(z)#
Parameters:

z (NxK matrix) – data. z may be complex

Returns:

f (NxK matrix) – the Psi function computed at z.

Examples#

psi(1)

The solution printed is

-0.577215

Remarks#

This program uses the analytical derivative of the log of the Lanczos series approximation for the Gamma function.

References#

    1. Lanczos, SIAM JNA 1, 1964. pp. 86-96.

    1. Luke, ‘’The Special … approximations,’’ 1969 pp. 29-31.

    1. Luke, ‘’Algorithms … functions,’’ 1977.

    1. Spouge, SIAM JNA 31, 1994. pp. 931.

    1. Press, ‘’Numerical Recipes.’’

    1. Chang, ‘’Computation of special functions,’’ 1996.

  1. Original code by Paul Godfrey