Description Usage Arguments Details Value Examples
The Psi function is defined as
ψ(z) = \frac{d}{dz} \log Γ(z) = \frac{Γ'(z)}{Γ(z)}
which is also called the digamma function.
1 | sp.psi(z)
|
z |
real or complex argument. |
The computation utilizes an asymptotic expansion and a recurrence relation.
Returns the value of the Psi function.
1 2 3 4 5 6 7 8 9 10 11 12 13 | Psi <- Vectorize(sp.psi)
print(Psi(1), digits = 16)
# [1] -0.5772156649015329 # Euler's Gamma constant
print(Psi(1/2), digits = 16)
# [1] -1.963510026021424 # -Gamma - 2*log(2)
## Not run:
x <- seq(-5, 5, length.out = 501)
y <- Psi(x)
plot(x, y, type = 'l', col = "blue",
main = "Psi function")
grid()
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.