Evaluate the Digamma Function

DESCRIPTION:

Evaluates the digamma function, the derivative of the log gamma function.

USAGE:

digamma(z)

REQUIRED ARGUMENTS:

z
a numeric or complex scalar, vector, or bdVector.

VALUE:

the digamma function evaluated for each element in z.

DETAILS:

The digamma function is the derivative of the log gamma function (Abramowitz and Stegun (1965, p. 258). The Spotfire S+ digamma function is taken from the MASS library of Venables and Ripley (1997).

REFERENCES:



Abramowitz, M., and Stegun, I. A. (Eds.). (1965). Handbook of Mathematical Functions. New York: Dover.

Venables, W. N. and Ripley, B. D. (1997). Modern Applied Statistics with S-PLUS, Second Ed. New York: Springer.

SEE ALSO:

, .

EXAMPLES:

digamma(5)  # Gives: 1.506118

# Numerical derivatives using log gamma and gamma functions
(lgamma(5+1.0e-6)-lgamma(5))/1.0e-6  # Gives: 1.506118

(gamma(5+1.0e-6)-gamma(5))/1.0e-6/gamma(5)  # Gives: 1.506119