Tutorials › Multivariate Statistics (Graduate) › Log-Determinants Of Wishart Matrices

Wishart Sampling Theory · Tutorial 128 of 975

Log-Determinants Of Wishart Matrices

Learn how Wishart degrees of freedom and scale determine the mean and variance of the log determinant, and how to calculate both from chi-square factors.

Intermediate 10 min read

What You'll Learn

  • State the chi-square factorization of a positive-definite Wishart determinant.
  • Derive the mean and variance of the logarithm of a chi-square random variable.
  • Express the Wishart log-determinant moments using digamma and trigamma functions.
  • Evaluate the moments in scalar, bivariate, and three-dimensional examples.
  • Distinguish the expected log determinant from the logarithm of the expected determinant.

Why Study a Wishart Log Determinant?

A positive-definite matrix has a determinant that measures volume scaling: a linear transformation with matrix \(A\) scales volume by \(|A|\). Its logarithm, \(\log|A|\), turns products of scale factors into sums and is often easier to analyze than the determinant itself. For a random Wishart matrix, the distribution of the determinant can be reduced to independent chi-square variables, so its log moments can be calculated explicitly.

This tutorial derives those moments. The central calculation is the mean and variance of \(\log Q\) when \(Q\) has a chi-square distribution. Applying that calculation to the independent factors of a Wishart determinant gives formulas that depend on the degrees of freedom and dimension, while the scale matrix contributes only a constant shift to the mean.

Wishart Determinant Factorization

Definition: Let \(W\sim W_p(\nu,\Sigma)\) be a central \(p\)-dimensional Wishart matrix with positive-definite scale matrix \(\Sigma\) and degrees of freedom \(\nu>p-1\). Its Bartlett factorization implies $$ |W|\ \overset{d}{=}\ |\Sigma|\prod_{j=1}^{p} Q_j, \qquad Q_j\ \text{independent},\quad Q_j\sim\chi^2_{\nu-j+1}. $$ Here \(\chi^2_k\) denotes a chi-square distribution with \(k>0\) degrees of freedom. The degrees of freedom in the product are \(\nu,\nu-1,\ldots,\nu-p+1\), all positive under the stated condition.

The factorization is a distributional identity; it does not assert that the factors are diagonal entries of \(W\). Since each \(Q_j\) is positive with probability one, \(W\) is positive definite with probability one in this setting, and \(\log|W|\) is well-defined. Taking logarithms of the factorization gives

$$ \log|W|\ \overset{d}{=}\ \log|\Sigma|+\sum_{j=1}^{p}\log Q_j. $$

Thus, the log-determinant calculation reduces to finding the first two moments of \(\log Q\). We derive those moments before applying them to examples.

Log Moments of a Chi-Square Variable

Let \(Q\sim\chi^2_k\), where \(k>0\), and put \(a=k/2\). The density of \(Q\) is

$$ f_Q(q)=\frac{q^{a-1}e^{-q/2}}{2^a\Gamma(a)},\qquad q>0. $$

For \(t>-a\), integration against this density gives the moment-generating function of \(\log Q\):

$$ E[e^{t\log Q}] =E[Q^t] =\frac{1}{2^a\Gamma(a)}\int_0^\infty q^{a+t-1}e^{-q/2}\,dq =2^t\frac{\Gamma(a+t)}{\Gamma(a)}. $$

Define the digamma and trigamma functions by \(\psi(x)=\frac{d}{dx}\log\Gamma(x)\) and \(\psi_1(x)=\frac{d}{dx}\psi(x)\), for \(x>0\). The log moment-generating function is

$$ K(t)=\log E[e^{t\log Q}] =t\log 2+\log\Gamma(a+t)-\log\Gamma(a). $$

Because \(a>0\), this expression is finite on an open interval containing zero. Its first two derivatives at zero are the mean and variance of \(\log Q\). This use of derivatives is valid directly from the density: for \(t\) in any sufficiently small closed interval around zero, the integrands obtained by differentiating once or twice are bounded by an integrable function proportional near zero to \(q^{a-\epsilon-1}(1+|\log q|^2)\), and at infinity to a polynomial times \(e^{-q/2}\), for some \(0<\epsilon<a\).

Theorem: If \(Q\sim\chi^2_k\) with \(k>0\), then $$ E[\log Q]=\log 2+\psi(k/2), \qquad \operatorname{Var}(\log Q)=\psi_1(k/2). $$

Proof. Differentiating \(K(t)\) yields \(K'(t)=\log 2+\psi(a+t)\) and \(K''(t)=\psi_1(a+t)\). Evaluating at zero gives \(E[\log Q]=K'(0)=\log 2+\psi(a)\) and \(\operatorname{Var}(\log Q)=K''(0)=\psi_1(a)\). Substituting \(a=k/2\) proves both formulas. \(\square\)

Mean and Variance for a Wishart Log Determinant

The independent factors in the determinant factorization make the expectations add, and independence also makes the variances add. Applying the chi-square formulas term by term gives the main result.

Theorem: If \(W\sim W_p(\nu,\Sigma)\), with \(\Sigma\) positive definite and \(\nu>p-1\), then $$ E[\log|W|] =\log|\Sigma|+\sum_{j=1}^{p} \left\{\log 2+\psi\!\left(\frac{\nu-j+1}{2}\right)\right\}, $$ and $$ \operatorname{Var}(\log|W|) =\sum_{j=1}^{p}\psi_1\!\left(\frac{\nu-j+1}{2}\right). $$

Proof. By the determinant factorization, \(\log|W|\) has the same distribution as \(\log|\Sigma|+\sum_{j=1}^{p}\log Q_j\), where the \(Q_j\) are independent and \(Q_j\sim\chi^2_{\nu-j+1}\). Each degree of freedom \(\nu-j+1\) is positive, so the chi-square log-moment formulas apply. Linearity of expectation gives the displayed sum for the mean, with the constant \(\log|\Sigma|\) included. Independence gives \(\operatorname{Var}(\sum_j\log Q_j)=\sum_j\operatorname{Var}(\log Q_j)\); adding a constant does not change variance. Substituting the degrees of freedom proves the variance formula. \(\square\)

The mean depends on \(\Sigma\) through \(\log|\Sigma|\), while the variance does not depend on \(\Sigma\). Changing the scale matrix therefore shifts the log-determinant distribution without changing its variance.

Worked Calculations

Worked Example: A Scalar Wishart Matrix

Let \(W\sim W_1(3,4)\), so the scale matrix is the scalar \(\Sigma=4\), with \(|\Sigma|=4\). The determinant factorization is \(W\overset{d}{=}4Q\), where \(Q\sim\chi^2_3\). Therefore,

Mean. Here \(k/2=3/2\), and the digamma recurrence and half-integer value give \(\psi(3/2)=\psi(1/2)+2=-\gamma-2\log 2+2\). Hence

$$ E[\log W] =\log 4+\log 2+\psi(3/2) =\log 2+2-\gamma \approx 2.115932. $$

The final approximation uses \(\gamma\approx0.5772156649\), giving \(0.6931471806+2-0.5772156649=2.1159315157\), which rounds to \(2.115932\).

Variance. The trigamma identity \(\psi_1(1/2)=\pi^2/2\) and recurrence \(\psi_1(x+1)=\psi_1(x)-1/x^2\) give

$$ \operatorname{Var}(\log W) =\psi_1(3/2) =\frac{\pi^2}{2}-4 \approx 0.934802. $$

This example also checks the scale effect: the factor 4 adds \(\log 4\) to \(\log Q\) and does not alter its variance.

Worked Example: A Bivariate Wishart Matrix

Let \(W\sim W_2(4,\Sigma)\), where \(\Sigma=\begin{pmatrix}2&0\\0&1\end{pmatrix}\). Then \(|\Sigma|=2\), and the determinant factors have degrees of freedom 4 and 3. Thus

$$ \log|W|\ \overset{d}{=}\ \log 2+\log Q_1+\log Q_2, \qquad Q_1\sim\chi^2_4,\quad Q_2\sim\chi^2_3, $$

with \(Q_1,Q_2\) independent. For the mean, use \(\psi(2)=1-\gamma\) and \(\psi(3/2)=2-\gamma-2\log2\):

$$ \begin{aligned} E[\log|W|] &=\log2+\{\log2+\psi(2)\}+\{\log2+\psi(3/2)\}\\ &=\log2+3-2\gamma\\ &\approx 2.538716. \end{aligned} $$

Using \(\gamma\approx0.5772156649\), the exact expression is approximately \(0.6931471806+3-1.1544313298=2.5387158508\), which rounds to \(2.538716\).

For the variance, \(\psi_1(2)=\pi^2/6-1\) and \(\psi_1(3/2)=\pi^2/2-4\), so

$$ \operatorname{Var}(\log|W|) =\left(\frac{\pi^2}{6}-1\right)+\left(\frac{\pi^2}{2}-4\right) =\frac{2\pi^2}{3}-5 \approx 1.579736. $$

This is a low-dimensional instance of the general result: the two chi-square factors contribute separate log means and variances.

Worked Example: A Three-Dimensional Identity-Scale Case

Let \(W\sim W_3(3,I_3)\), where \(I_3\) is the \(3\times3\) identity matrix. The scale determinant is 1, and the chi-square degrees of freedom are 3, 2, and 1. The digamma values are \(\psi(3/2)=2-\gamma-2\log2\), \(\psi(1)=-\gamma\), and \(\psi(1/2)=-\gamma-2\log2\). Therefore,

$$ \begin{aligned} E[\log|W|] &=3\log2+\psi(3/2)+\psi(1)+\psi(1/2)\\ &=2-3\gamma-\log2\\ &\approx -0.424794. \end{aligned} $$

The value can be negative even though \(|W|>0\) almost surely: a positive random quantity may be less than 1 often enough that its logarithm has a negative mean. For the variance, use \(\psi_1(3/2)=\pi^2/2-4\), \(\psi_1(1)=\pi^2/6\), and \(\psi_1(1/2)=\pi^2/2\):

$$ \operatorname{Var}(\log|W|) =\frac{7\pi^2}{6}-4 \approx 7.514538. $$

The variance is substantial here because one factor has only one degree of freedom, producing a highly variable logarithm.

Interpretation and a Common Pitfall

The expected log determinant summarizes average log-volume scaling, and its variance quantifies the variability of that log scale. The chi-square factorization makes both quantities accessible without integrating the Wishart density over all matrix entries. It also makes clear which part of the result comes from dimension and degrees of freedom and which part comes from the scale matrix.

Common mistake: taking the logarithm after taking the expectation. In general, \(E[\log|W|]\) is not \(\log E[|W|]\). These are different summaries. For a positive random variable \(D\), concavity of the logarithm gives \(E[\log D]\leq\log E[D]\) when the expectations exist; equality requires \(D\) to be constant almost surely. The correct calculation for the log determinant uses the chi-square log moments above, not a determinant expectation placed inside a logarithm.

Key takeaway: Factor the determinant into independent chi-square terms, take logarithms to turn the product into a sum, and use \(\log 2+\psi(k/2)\) and \(\psi_1(k/2)\) for each factor's mean and variance.

Check Your Understanding

Use the determinant factorization and the log-chi-square formulas to answer the following.

  1. For \(W\sim W_2(6,I_2)\), what degrees of freedom appear in the two independent determinant factors?
  2. Why does changing \(\Sigma\) change \(E[\log|W|]\) but not \(\operatorname{Var}(\log|W|)\)?
  3. State the mean and variance of \(\log Q\) when \(Q\sim\chi^2_k\).
  4. For \(W\sim W_1(2,1)\), write the mean and variance of \(\log|W|\) using \(\psi\) and \(\psi_1\).
  5. Explain why \(\log E[|W|]\) is not generally a valid substitute for \(E[\log|W|]\).
Clinical Biostats