MATLAB Function Reference    

Psi (polygamma) function



Y = psi(X) evaluates the function for each element of array X. X must be real and nonnegative. The function, also known as the digamma function, is the logarithmic derivative of the gamma function

Y = psi(k,X) evaluates the kth derivative of at the elements of X. psi(0,X) is the digamma function, psi(1,X) is the trigamma function, psi(2,X) is the tetragamma function, etc.

Y = psi(k0:k1,X) evaluates derivatives of order k0 through k1 at X. Y(k,j) is the (k-1+k0)th derivative of , evaluated at X(j).


Example 1. Use the psi function to calculate Euler's constant, .

Example 2. The trigamma function of 2, psi(1,2), is the same as .

Example 3. This code produces the first page of Table 6.1 in Abramowitz and Stegun [1].

Example 4. This code produces a portion of Table 6.2 in [1].

See Also

gamma, gammainc, gammaln


[1]  Abramowitz, M. and I. A. Stegun, Handbook of Mathematical Functions, Dover Publlications, 1965, Sections 6.3 and 6.4.

  propedit (COM) pwd