psi: Psi (Polygamma) Function

Description Usage Arguments Details Value Examples

View source: R/psi.R

Description

Arbitrary order Polygamma function valid in the entire complex plane.

Usage

1
psi(k, z)

Arguments

k

order of the polygamma function, whole number greater or equal 0.

z

numeric complex number or vector.

Details

Computes the Polygamma function of arbitrary order, and valid in the entire complex plane. The polygamma function is defined as

ψ(n, z) = \frac{d^{n+1}}{dz^{n+1}} \log(Γ(z))

If n is 0 or absent then psi will be the Digamma function. If n=1,2,3,4,5 etc. then psi will be the tri-, tetra-, penta-, hexa-, hepta- etc. gamma function.

Value

Returns a complex number or a vector of complex numbers.

Examples

1
2
3
4
5
psi(2) - psi(1)         # 1
-psi(1)                 # Eulers constant: 0.57721566490153  [or, -psi(0, 1)]
psi(1, 2)               # pi^2/6 - 1     : 0.64493406684823
psi(10, -11.5-0.577007813568142i)
                        # is near a root of the decagamma function

Example output

[1] 1
[1] 0.5772157
[1] 0.6449341
[1] -4.984032e-06+6.22611e-07i

pracma documentation built on Nov. 22, 2017, 1:08 a.m.