Documentation

This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

psi

Psi (polygamma) function

Syntax

Y = psi(X)
Y = psi(k,X)

Description

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

ψ(x)=digamma(x)=d(log(Γ(x)))dx=d(Γ(x))/dxΓ(x)

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.

Examples

Example 1

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

format long
-psi(1)
ans =
   0.57721566490153

-psi(0,1)
ans =
   0.57721566490153

Example 2

The trigamma function of 2, psi(1,2), is the same as (π2/6) – 1.

format long
psi(1,2)
ans =
   0.64493406684823

pi^2/6 - 1
ans =
   0.64493406684823

More About

collapse all

Tall Array Support

This function supports tall arrays with the limitation:

For the syntax Y = psi(k,X), k must be a non-tall scalar.

For more information, see Tall Arrays.

References

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

See Also

| |

Introduced before R2006a

Was this topic helpful?