Tutorials › Multivariate Statistics (Graduate) › Worked Covariance-Model Comparisons in Two Dimensions

Model-Based Clustering · Tutorial 660 of 975

Worked Covariance-Model Comparisons in Two Dimensions

Learn to read the geometry and parameter cost of spherical, diagonal, shared-orientation, and unrestricted covariance models in two dimensions.

Advanced 10 min read

What You'll Learn

  • Write the covariance restrictions for four two-dimensional clustering models
  • Derive Gaussian contour axes and orientations from covariance eigenvalues
  • Compare covariance-only and total mixture parameter counts
  • Check whether a pair of fitted covariance matrices shares coordinate axes or orientation
  • Identify the nesting relationships among the covariance structures
  • Avoid confusing shared orientation with a shared covariance matrix

Why Compare Covariance Structures?

In model-based clustering, each Gaussian component describes both a cluster’s location and its spread. In two dimensions, that spread has a direct geometric interpretation: a component’s equal-density contours are ellipses, and its covariance matrix determines their sizes, elongations, and directions. A covariance model controls which of those shapes different components may have.

The choice is a trade-off in representation and parsimony. A spherical model permits only circular contours, while an unrestricted model permits each component to have its own ellipse. Intermediate structures impose more specific geometric constraints. Comparing them means checking both the contours those constraints allow and the number of free covariance parameters they require.

Definition: For \(G\) two-dimensional Gaussian components, write \(\Sigma_g\) for the positive-definite covariance matrix of component \(g\). The spherical structure has \(\Sigma_g=\lambda_g I_2\); the diagonal structure has \(\Sigma_g=\operatorname{diag}(\lambda_{g1},\lambda_{g2})\); the shared-orientation structure has \(\Sigma_g=R(\phi)\operatorname{diag}(\lambda_{g1},\lambda_{g2})R(\phi)^\mathsf{T}\) with one common rotation \(R(\phi)\); and the unrestricted structure allows each \(\Sigma_g\) to be any positive-definite symmetric \(2\times2\) matrix. All displayed eigenvalue parameters are positive.

Here \(I_2\) is the two-dimensional identity matrix and \(R(\phi)\) is the rotation matrix \( \begin{pmatrix}\cos\phi&-\sin\phi\\ \sin\phi&\cos\phi\end{pmatrix} \). A diagonal structure aligns every component’s principal axes with the two coordinate axes. A shared-orientation structure instead permits those axes to be rotated, but requires the same pair of principal directions for every component. It does not require the components to have the same covariance matrix: their eigenvalues can differ.

How Covariance Determines a Contour

For a component with mean vector \(\mu_g\), a Gaussian equal-density contour is specified by a constant \(c>0\). The contour consists of points \(x\) satisfying a squared Mahalanobis distance of \(c\). If \(v_1,v_2\) are orthonormal eigenvectors of \(\Sigma_g\), with corresponding eigenvalues \(\lambda_1,\lambda_2\), the contour’s axes lie in those eigenvector directions.

Result: The contour \( (x-\mu_g)^\mathsf{T}\Sigma_g^{-1}(x-\mu_g)=c \) is an ellipse centered at \(\mu_g\). Its semiaxis lengths in the covariance eigenvector directions are \(\sqrt{c\lambda_1}\) and \(\sqrt{c\lambda_2}\).

To derive the result, decompose the covariance as \(\Sigma_g=V\Lambda V^\mathsf{T}\), where \(V\) has columns \(v_1,v_2\) and \(\Lambda=\operatorname{diag}(\lambda_1,\lambda_2)\). Set \(y=V^\mathsf{T}(x-\mu_g)\). Since \(V^\mathsf{T}V=I_2\), substitution into the contour equation gives

$$ \frac{y_1^2}{\lambda_1}+\frac{y_2^2}{\lambda_2}=c \quad\Longleftrightarrow\quad \frac{y_1^2}{c\lambda_1}+\frac{y_2^2}{c\lambda_2}=1. $$

This is the equation of an ellipse with semiaxis lengths \(\sqrt{c\lambda_1}\) and \(\sqrt{c\lambda_2}\). The associated axes are the columns of \(V\), so they are the covariance eigenvector directions. This also explains why a spherical covariance gives a circle: both eigenvalues are equal, and the contour has the same radius in every direction.

Worked Example: Reading Four Contour Structures

Suppose two fitted components have means \(\mu_1=(-2,0)^\mathsf{T}\) and \(\mu_2=(2,0)^\mathsf{T}\). Compare the following candidate covariance pairs using \(c=1\). The choice \(c=1\) gives a convenient contour for comparing shape; it is not the 95% contour.

Spherical: Let \(\Sigma_1=I_2\) and \(\Sigma_2=4I_2\). Their eigenvalues are \((1,1)\) and \((4,4)\), so their \(c=1\) contours are circles with radii \(1\) and \(2\). They differ in size but not in shape or orientation.

Diagonal: Let \(\Sigma_1=\operatorname{diag}(4,1)\) and \(\Sigma_2=\operatorname{diag}(1,9)\). The first component has semiaxes \(2\) and \(1\), with its longer axis horizontal; the second has semiaxes \(1\) and \(3\), with its longer axis vertical. Both are aligned with the coordinate axes, although the direction of the longer axis differs between components.

Shared orientation: Let both covariance matrices use a rotation of \(30^\circ\), with eigenvalues \((4,1)\) for component 1 and \((9,2)\) for component 2. The \(c=1\) semiaxes are respectively \((2,1)\) and \((3,\sqrt{2})\). Both ellipses have the same principal directions, rotated \(30^\circ\) from the coordinate axes.

Unrestricted: Let \(\Sigma_1=\operatorname{diag}(4,1)\) and \(\Sigma_2=\begin{pmatrix}5&4\\4&5\end{pmatrix}\). The first contour has semiaxes \(2,1\) along the coordinate axes. The second matrix has eigenvalues \(9,1\) and eigenvectors proportional to \((1,1)^\mathsf{T}\) and \((1,-1)^\mathsf{T}\), so its semiaxes are \(3,1\) along directions rotated \(45^\circ\). The two components do not share principal directions, as allowed by an unrestricted structure.

Counting the Covariance Parameters

The covariance-only count records the number of free continuous parameters in the covariance matrices under a structure. Counts below are generic: they describe a model away from degenerate cases such as an exactly spherical covariance, where an orientation is not uniquely determined.

Result: For \(G\) components in two dimensions, the covariance-parameter counts are \(G\) for spherical, \(2G\) for diagonal, \(2G+1\) for shared orientation, and \(3G\) for unrestricted covariance.

The count follows by adding the free entries in each representation. A spherical component has one positive scale \(\lambda_g\), giving \(G\) parameters. A diagonal component has two positive variances, giving \(2G\). An unrestricted symmetric \(2\times2\) covariance has two diagonal entries and one off-diagonal entry, giving three parameters per component, or \(3G\) altogether. For shared orientation, there are two eigenvalues for each component and one common angle, giving \(2G+1\).

For a Gaussian mixture with \(G\) components, each component also has a two-dimensional mean, and the \(G\) mixing proportions sum to one. Thus there are \(2G\) mean parameters and \(G-1\) free mixing proportions. Adding these to the covariance counts gives the following totals:

$$ \begin{aligned} \text{spherical: }&2G+(G-1)+G=4G-1,\\ \text{diagonal: }&2G+(G-1)+2G=5G-1,\\ \text{shared orientation: }&2G+(G-1)+(2G+1)=5G,\\ \text{unrestricted: }&2G+(G-1)+3G=6G-1. \end{aligned} $$

Worked Example: Comparing Parameter Counts for Two Components

Take \(G=2\). There are \(2G=4\) mean parameters and \(G-1=1\) free mixing proportion, so every structure has five non-covariance parameters.

For spherical covariances, the covariance count is \(G=2\), making the total \(5+2=7\). For diagonal covariances, the covariance count is \(2G=4\), making the total \(5+4=9\). For shared orientation, the two components contribute four eigenvalue parameters and the common orientation contributes one, making the covariance count \(4+1=5\) and the total \(10\). For unrestricted covariances, each component contributes three entries, so the covariance count is \(3G=6\) and the total is \(11\).

The counts describe model dimension, not fit quality. In particular, a smaller count alone does not establish that a model represents the observed clusters adequately.

The shared-orientation count uses one angle, not one angle per component. If every component had its own angle, the covariance count would be \(3G\), the unrestricted count in two dimensions. When all covariances happen to be spherical, the common angle is unidentifiable because rotating a circle changes nothing; the generic count does not describe that special degeneracy.

Which Structures Can Represent Which Covariances?

The constraints form a nested sequence: every spherical pair is diagonal, every diagonal pair is representable with a common orientation, and every shared-orientation pair is unrestricted. The inclusions follow directly from the definitions. A spherical matrix is diagonal; a diagonal pair is a shared-orientation pair with \(\phi=0\); and every shared-orientation covariance is symmetric positive definite, so it is allowed by the unrestricted structure.

For \(G\geq2\), these inclusions are strict. For spherical versus diagonal, a matrix such as \(\operatorname{diag}(4,1)\) is diagonal but not spherical. For diagonal versus shared orientation, a pair of matrices obtained by rotating \(\operatorname{diag}(4,1)\) by \(30^\circ\) is shared-orientation but not diagonal. For shared orientation versus unrestricted, use \(\Sigma_1=\operatorname{diag}(4,1)\) and \(\Sigma_2=\begin{pmatrix}5&4\\4&5\end{pmatrix}\): the first has principal directions along the coordinate axes, while the second has directions at \(45^\circ\), so no single orientation represents both. These examples establish strictness without relying only on parameter counts. \(\square\)

Worked Example: Checking a Pair of Fitted Matrices

Consider again \(\Sigma_1=\begin{pmatrix}4&0\\0&1\end{pmatrix}\) and \(\Sigma_2=\begin{pmatrix}5&4\\4&5\end{pmatrix}\). First check that both are valid covariance matrices. The first has positive eigenvalues \(4,1\). For the second, the eigenvectors \((1,1)^\mathsf{T}\) and \((1,-1)^\mathsf{T}\) have eigenvalues \(9\) and \(1\), respectively. Thus both matrices are positive definite.

Neither matrix is spherical because each has unequal eigenvalues. The first is diagonal, but the second has nonzero off-diagonal entries, so the pair is not diagonal. Their principal directions differ: the first uses the coordinate axes, while the second uses directions at \(45^\circ\). Therefore the pair cannot satisfy a shared-orientation constraint. It is representable under the unrestricted structure.

For two components, that unrestricted model has six covariance parameters. The corresponding shared-orientation model has five, but the missing degree of freedom is consequential here: it would force the components to have the same principal directions.

Common Mistake and Practical Interpretation

Mistake: “Shared orientation means the components share a covariance matrix, so they must have the same ellipse.” That conclusion confuses orientation with the full covariance. Under shared orientation, the eigenvectors are common, but the eigenvalues may differ by component. The ellipses can therefore have different sizes and different elongations while retaining the same principal directions.

A useful comparison proceeds in two checks. First, inspect the eigenvalue pattern and eigenvectors: are the contours circular, coordinate-aligned, aligned to common rotated axes, or allowed to point in different directions? Second, record the parameter cost. For example, in two dimensions a shared-orientation model uses one common angle, whereas an unrestricted model can adjust each component’s orientation independently.

These checks clarify what each covariance structure permits. They do not by themselves determine which model should be selected: that requires evaluating fitted models and their fit or selection criteria. The central geometric distinction is precise, however: spherical restricts shape, diagonal fixes axes to the coordinates, shared orientation ties principal directions across components, and unrestricted removes that cross-component orientation constraint.

Check Your Understanding

Use the definitions and calculations above to answer the following.

  1. For \(\Sigma=\operatorname{diag}(9,4)\), what are the semiaxis lengths of the \(c=1\) contour, and which direction is the longer axis?
  2. How many covariance parameters are there for \(G=3\) components under a shared-orientation structure?
  3. Can two diagonal covariance matrices have different directions for their longer axes while still satisfying a diagonal structure? Explain.
  4. What is the total number of parameters for a two-component mixture with unrestricted two-dimensional covariances, counting means and mixing proportions?
  5. Why does a common orientation not imply that two components have the same contour size or elongation?
Clinical Biostats