# Multivariate gamma function

In mathematics, the multivariate gamma function Γp is a generalization of the gamma function. It is useful in multivariate statistics, appearing in the probability density function of the Wishart and inverse Wishart distributions, and the matrix variate beta distribution.

It has two equivalent definitions. One is given as the following integral over the $p\times p$ positive-definite real matrices:

$\Gamma _{p}(a)=\int _{S>0}\exp \left(-{\rm {tr}}(S)\right)\left|S\right|^{a-(p+1)/2}dS,$ (note that $\Gamma _{1}\left(a\right)$ reduces to the ordinary gamma function). The other one, more useful to obtain a numerical result is:

$\Gamma _{p}(a)=\pi ^{p(p-1)/4}\prod _{j=1}^{p}\Gamma \left[a+(1-j)/2\right].$ From this, we have the recursive relationships:

$\Gamma _{p}(a)=\pi ^{(p-1)/2}\Gamma (a)\Gamma _{p-1}(a-{\tfrac {1}{2}})=\pi ^{(p-1)/2}\Gamma _{p-1}(a)\Gamma [a+(1-p)/2].$ Thus

• $\Gamma _{1}(a)=\Gamma (a)$ • $\Gamma _{2}(a)=\pi ^{1/2}\Gamma (a)\Gamma (a-1/2)$ • $\Gamma _{3}(a)=\pi ^{3/2}\Gamma (a)\Gamma (a-1/2)\Gamma (a-1)$ and so on.

## Derivatives

We may define the multivariate digamma function as

$\psi _{p}(a)={\frac {\partial \log \Gamma _{p}(a)}{\partial a}}=\sum _{i=1}^{p}\psi (a+(1-i)/2),$ and the general polygamma function as

$\psi _{p}^{(n)}(a)={\frac {\partial ^{n}\log \Gamma _{p}(a)}{\partial a^{n}}}=\sum _{i=1}^{p}\psi ^{(n)}(a+(1-i)/2).$ ### Calculation steps

• Since
$\Gamma _{p}(a)=\pi ^{p(p-1)/4}\prod _{j=1}^{p}\Gamma \left(a+{\frac {1-j}{2}}\right),$ it follows that
${\frac {\partial \Gamma _{p}(a)}{\partial a}}=\pi ^{p(p-1)/4}\sum _{i=1}^{p}{\frac {\partial \Gamma \left(a+{\frac {1-i}{2}}\right)}{\partial a}}\prod _{j=1,j\neq i}^{p}\Gamma \left(a+{\frac {1-j}{2}}\right).$ ${\frac {\partial \Gamma (a+(1-i)/2)}{\partial a}}=\psi (a+(i-1)/2)\Gamma (a+(i-1)/2)$ it follows that
{\begin{aligned}{\frac {\partial \Gamma _{p}(a)}{\partial a}}&=\pi ^{p(p-1)/4}\prod _{j=1}^{p}\Gamma (a+(1-j)/2)\sum _{i=1}^{p}\psi (a+(1-i)/2)\\[4pt]&=\Gamma _{p}(a)\sum _{i=1}^{p}\psi (a+(1-i)/2).\end{aligned}} 