A special mathematical function related to the gamma function, generalized for multivariate distributions. The multivariate digamma function is the derivative of the log of the multivariate gamma function; for \(p = 1\) it is the same as the univariate digamma function.

$$\psi_{p}(a)=\sum _{i=1}^{p}\psi(a+(1-i)/2) $$ where \(\psi\) is the univariate digamma function (the derivative of the log-gamma function).

mvdigamma(x, p)

Arguments

x

non-negative numeric vector, matrix, or array

p

positive integer, dimension of a square matrix

Value

vector of values of multivariate digamma function.

References

A. K. Gupta and D. K. Nagar 1999. Matrix variate distributions. Chapman and Hall.

Multivariate gamma function. In Wikipedia, The Free Encyclopedia,from https://en.wikipedia.org/w/index.php?title=Multivariate_gamma_function

See also

Examples

digamma(1:10)
#>  [1] -0.5772157  0.4227843  0.9227843  1.2561177  1.5061177  1.7061177
#>  [7]  1.8727843  2.0156415  2.1406415  2.2517526
mvdigamma(1:10, 1L)
#>  [1] -0.5772157  0.4227843  0.9227843  1.2561177  1.5061177  1.7061177
#>  [7]  1.8727843  2.0156415  2.1406415  2.2517526