Trigamma Function

DESCRIPTION:

Calculates the trigamma function, which is the second derivative of the logarithm of the gamma function, for complex vector arguments.

USAGE:

trigamma(z) 

REQUIRED ARGUMENTS:

z
Vector argument. May be real or complex but must have positive real part.

VALUE:

Vector of trigamma(z) values.

DETAILS:

Uses an asymptotic expansion where Re(z) > 5 and a recurrence formula to such a case where Re(z) <= 5. Accuracy is good. This function is based upon the function trigamma in Venables and Ripley (1997).

REFERENCE:

M. Abramowitz and I. A. Stegun (1965) Handbook of Mathematical Functions. Dover.

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

SEE ALSO:

EXAMPLES:

x <- seq(1, 2, .1)
matrix(c(x, trigamma(x)), ncol=2)