Tutorials › Multivariate Statistics (Graduate) › Shared Versus Component-Specific Covariances

Model-Based Clustering · Tutorial 661 of 975

Shared Versus Component-Specific Covariances

See how sharing covariance information changes Gaussian cluster shapes and estimates, and when the extra pooling is useful or restrictive.

Advanced 10 min read

What You'll Learn

  • Distinguish a shared full covariance matrix from separate full covariance matrices across mixture components.
  • Derive the maximum-likelihood covariance estimates when component labels are known.
  • Explain how shared covariance pools within-component scatter without including between-component separation.
  • Interpret the geometric restrictions imposed by a common covariance matrix.
  • Identify the trade-off between greater statistical stability and reduced component-specific flexibility.
  • Extend the covariance formulas to weighted component memberships in an EM update.

Why Decide Whether Covariances Are Shared?

In a Gaussian clustering model, each component has a mean and a covariance matrix. The mean locates a component; its covariance describes the spread and dependence of observations around that location. A modeling decision is whether components should have one covariance matrix in common or a different covariance matrix for each component. This choice affects both the shapes the model can represent and how much information is used to estimate each shape.

Sharing can stabilize estimates when components have limited data and similar dispersion patterns. But it also imposes a substantive restriction: if the components truly differ in spread, shape, or orientation, a common covariance cannot represent those differences. Conversely, estimating separate matrices offers flexibility but asks each component to supply enough information to estimate its own covariance reliably.

Definition: For \(K\) Gaussian components in \(d\) dimensions, a shared-covariance model has \(\Sigma_1=\cdots=\Sigma_K=\Sigma\), where \(\Sigma\) is positive definite. A component-specific-covariance model estimates a separate positive-definite matrix \(\Sigma_k\) for each component \(k\). In either model, component \(k\) has its own mean \(\mu_k\); sharing covariance does not mean sharing location.

The corresponding mixture density is \(f(x)=\sum_{k=1}^K\pi_k\phi_d(x;\mu_k,\Sigma_k)\), where \(\pi_k>0\), \(\sum_k\pi_k=1\), and \(\phi_d\) is the \(d\)-variate normal density. The shared model sets all the \(\Sigma_k\) equal; the component-specific model does not. This tutorial compares these two full-matrix choices, not the additional restrictions imposed by spherical, diagonal, or other covariance families.

What Covariance Sharing Means Geometrically

A Gaussian component’s equal-density contours are ellipsoids centered at its mean. The covariance eigenvectors give their principal directions, and the eigenvalues determine their squared axis lengths at a fixed density level. If all components share \(\Sigma\), their ellipsoids have the same shape, size, and orientation: they are translated copies centered at different means. They may overlap, and their mixture weights may differ, but the covariance matrix does not allow one component to be more elongated or differently oriented than another.

With component-specific matrices, each component can have its own ellipsoid. One cluster can be broad and nearly circular while another is narrow and elongated; their principal directions need not agree. That flexibility can describe genuine heterogeneity, but it also makes each estimate depend on its component’s own observations or effective membership.

Worked Example: Same Ellipse, Different Centers

Consider two bivariate components with means \(\mu_1=(0,0)^\mathsf{T}\) and \(\mu_2=(5,2)^\mathsf{T}\), and shared covariance \( \Sigma=\begin{pmatrix}4&1.2\\1.2&1\end{pmatrix} \). Its determinant is \(4(1)-1.2^2=2.56>0\), and its first diagonal entry is positive, so it is positive definite. Both components therefore have the same tilted ellipse, translated from \((0,0)\) to \((5,2)\).

Now instead take \(\Sigma_1=\begin{pmatrix}9&0\\0&1\end{pmatrix}\) and \(\Sigma_2=\begin{pmatrix}1&0\\0&9\end{pmatrix}\). Each has determinant \(9>0\) and positive diagonal entries, hence is positive definite. The first component is stretched along the first coordinate; the second is stretched along the second coordinate. This difference in orientation and relative spread is unavailable under a shared covariance.

Estimating Covariance When Component Memberships Are Known

Suppose observations \(x_1,\ldots,x_n\in\mathbb{R}^d\) have known component labels \(z_i\in\{1,\ldots,K\}\). Write \(n_k\) for the number assigned to component \(k\), \(\bar{x}_k\) for its sample mean, and \(W_k=\sum_{i:z_i=k}(x_i-\bar{x}_k)(x_i-\bar{x}_k)^\mathsf{T}\) for its within-component scatter matrix. Assume each \(n_k>0\). The formulas below use maximum likelihood denominators, not the unbiased sample-covariance denominators.

Result: If each component has its own unrestricted positive-definite covariance, its Gaussian maximum-likelihood estimate is \(\hat{\Sigma}_k=W_k/n_k\), provided \(W_k\) is positive definite. If covariance is shared, the estimate is \(\hat{\Sigma}=(\sum_{k=1}^K W_k)/n\), provided the pooled within-component scatter is positive definite.

For separate covariances, each component’s likelihood depends on its own observations and its own covariance. For the shared model, all components contribute within-component scatter to one estimate. The pooled estimate is not, in general, an unweighted average of the separate estimates: it weights each by its component sample size.

Worked Example: Pooling Two Within-Component Scatter Matrices

Suppose \(d=2\), \(n_1=4\), \(n_2=6\), and the observed within-component scatter matrices are \(W_1=\begin{pmatrix}4&1\\1&2\end{pmatrix}\) and \(W_2=\begin{pmatrix}8&-2\\-2&6\end{pmatrix}\). Both are positive definite: their leading diagonal entries are positive and their determinants are \(7\) and \(44\), respectively.

Under separate covariances, the estimates are \(\hat{\Sigma}_1=W_1/4=\begin{pmatrix}1&0.25\\0.25&0.5\end{pmatrix}\) and \(\hat{\Sigma}_2=W_2/6=\begin{pmatrix}1.333&-0.333\\-0.333&1\end{pmatrix}\), with displayed decimals rounded to three places.

Under a shared covariance, add the scatter matrices and divide by the total sample size: \(W_1+W_2=\begin{pmatrix}12&-1\\-1&8\end{pmatrix}\), so \(\hat{\Sigma}=\begin{pmatrix}1.2&-0.1\\-0.1&0.8\end{pmatrix}\). Its determinant is \(0.95>0\), so the pooled estimate is positive definite. The two models do not simply produce the same estimate with different labels: the shared estimate combines evidence across components, whereas each separate estimate follows its own component’s scatter.

Why the Pooled Estimate Uses Within-Component Scatter

A shared covariance describes variation around each component’s own mean. It does not describe how far apart the component means are. This distinction is essential: a data set can have widely separated cluster centers even when observations are tightly concentrated around each center.

Theorem: For labeled observations, the total scatter about the overall mean decomposes into within-component scatter plus between-component scatter: \( \sum_{i=1}^n(x_i-\bar{x})(x_i-\bar{x})^\mathsf{T} =\sum_{k=1}^K W_k+\sum_{k=1}^K n_k(\bar{x}_k-\bar{x})(\bar{x}_k-\bar{x})^\mathsf{T} \), where \(\bar{x}=n^{-1}\sum_i x_i\). Thus the shared Gaussian covariance estimate uses \(\sum_k W_k/n\), not total scatter divided by \(n\).

To prove the decomposition, for an observation in component \(k\), write \(x_i-\bar{x}=(x_i-\bar{x}_k)+(\bar{x}_k-\bar{x})\). Expand the outer product and sum within component \(k\). The two cross-product sums vanish because \(\sum_{i:z_i=k}(x_i-\bar{x}_k)=0\). The remaining terms are \(W_k\) and \(n_k(\bar{x}_k-\bar{x})(\bar{x}_k-\bar{x})^\mathsf{T}\). Summing over \(k\) gives the result. \(\square\)

Worked Example: Separated Means Do Not Inflate the Shared Covariance

In one dimension, suppose two labeled components each contain two observations: component 1 has \(0,2\), and component 2 has \(8,10\). The component means are \(1\) and \(9\); the overall mean is \(5\). Each component has within-component scatter \(2\), so total within scatter is \(4\).

The shared-covariance maximum-likelihood estimate is therefore \(4/4=1\). By contrast, the total scatter about \(5\) is \((0-5)^2+(2-5)^2+(8-5)^2+(10-5)^2=25+9+9+25=68\). The between-component term is \(2(1-5)^2+2(9-5)^2=32+32=64\), and within plus between is \(4+64=68\), as the decomposition requires.

Using total scatter to estimate the common within-component variance would give \(68/4=17\), incorrectly treating the separation of the means as variation around a component mean. Each component’s separate maximum-likelihood variance is also \(2/2=1\) in this example.

Derivation of the Shared Maximum-Likelihood Estimate

For fixed labels and component means at their Gaussian maximum-likelihood estimates \(\bar{x}_k\), the part of the log-likelihood depending on a shared positive-definite \(\Sigma\) is \( \ell(\Sigma)=-\frac{n}{2}\log|\Sigma|-\frac{1}{2}\operatorname{tr}(\Sigma^{-1}W)+C \), where \(W=\sum_k W_k\) and \(C\) does not depend on \(\Sigma\). Assume \(W\) is positive definite, so \(\bar{W}=W/n\) is positive definite. Set \(C_\Sigma=\bar{W}^{-1/2}\Sigma\bar{W}^{-1/2}\), which is positive definite. Determinant and trace identities give \( \log|\Sigma|=\log|\bar{W}|+\log|C_\Sigma| \) and \( \operatorname{tr}(\Sigma^{-1}W)=n\operatorname{tr}(C_\Sigma^{-1}) \).

Let \(\lambda_1,\ldots,\lambda_d\) be the positive eigenvalues of \(C_\Sigma\). Up to constants independent of \(\Sigma\), maximizing the log-likelihood is equivalent to minimizing \(\sum_{j=1}^d(\log\lambda_j+1/\lambda_j)\). For every \(\lambda>0\), the function \(g(\lambda)=\log\lambda+1/\lambda\) has derivative \(g'(\lambda)=(\lambda-1)/\lambda^2\); it decreases up to \(1\) and increases after \(1\). Its unique minimum is \(g(1)=1\). Consequently the likelihood is maximized only when every \(\lambda_j=1\), which makes \(C_\Sigma=I\) and \(\Sigma=\bar{W}=W/n\). This proves the shared estimate under the stated positive-definiteness condition. \(\square\)

The same argument applied to the observations in one component, replacing \(n\) and \(W\) by \(n_k\) and \(W_k\), gives \(\hat{\Sigma}_k=W_k/n_k\) when \(W_k\) is positive definite. If a scatter matrix is singular, the unrestricted Gaussian covariance likelihood need not have a finite positive-definite maximizer; the formula should not be treated as a valid positive-definite estimate in that case.

Unknown Memberships and the Pooling Trade-Off

In a mixture model, component labels are not observed. Given current parameter values, let \(r_{ik}\) be the posterior responsibility of component \(k\) for observation \(x_i\), with \(r_{ik}\geq0\) and \(\sum_k r_{ik}=1\). In an expectation-maximization update, define \(N_k=\sum_i r_{ik}\) and \(\bar{x}_k=N_k^{-1}\sum_i r_{ik}x_i\), assuming \(N_k>0\). Maximizing the expected complete-data Gaussian log-likelihood gives the shared update \( \hat{\Sigma}=\frac{1}{n}\sum_k\sum_i r_{ik}(x_i-\bar{x}_k)(x_i-\bar{x}_k)^\mathsf{T} \), or, with component-specific covariances, \( \hat{\Sigma}_k=\frac{1}{N_k}\sum_i r_{ik}(x_i-\bar{x}_k)(x_i-\bar{x}_k)^\mathsf{T} \). These are maximizers of the EM covariance-update objective for the current responsibilities; they are not a claim that the observed mixture likelihood has a closed-form covariance maximizer.

The statistical trade-off follows directly. A shared estimate collects within-component information from all \(K\) groups, which can reduce the instability of estimating a full covariance from a small component. But if true component covariances differ, the pooled matrix compromises across them and may represent none of them well. Separate estimates can capture such differences, but each relies on fewer effective observations; a small or poorly dispersed component can yield an unstable or singular estimate. Sharing is therefore a modeling assumption, not merely a computational shortcut.

Common Mistake

A common error is to say that a shared covariance means the clusters have the same mean or occupy the same region. It means only that their covariance matrices are constrained to agree. Another error is to pool total scatter around the grand mean. The decomposition above shows why that adds between-component separation, although the covariance in the component Gaussian model describes within-component dispersion. Before interpreting a shared estimate, ask both what is pooled and what quantity the covariance is intended to describe.

Key takeaway: Shared covariance gives every component the same Gaussian shape and estimates that shape from pooled within-component scatter. Component-specific covariance allows distinct shapes but estimates each from its own component’s information. The choice trades flexibility against pooling and must match the intended model.

Check Your Understanding

Use the definitions and derivations above to answer these questions.

  1. For two components with different means but a shared covariance, which geometric features must their equal-density ellipses have in common?
  2. Why is the shared maximum-likelihood covariance weighted by component sample sizes rather than formed as an unweighted average of component covariance estimates?
  3. In the scatter decomposition, what does the between-component term measure, and why is it excluded from the within-component covariance estimate?
  4. What positive-definiteness condition is needed for the stated unrestricted covariance maximum-likelihood estimate?
  5. Give one situation in which pooling is advantageous and one in which a shared covariance could be misleading.
Clinical Biostats