Tutorials › Statistical Theory I - Probability and Distribution Theory › Singular Covariance Matrices and Exact Linear Relations

Variance and Covariance Structure · Tutorial 367 of 994

Singular Covariance Matrices and Exact Linear Relations

You will connect covariance-matrix singularity to zero-variance linear combinations and identify the resulting almost-sure affine constraint.

Intermediate 10 min read

What You'll Learn

  • State the finite-second-moment conditions for a covariance matrix.
  • Connect a quadratic form of the covariance matrix to the variance of a linear combination.
  • Prove the equivalence between singularity and a nonzero zero-variance combination.
  • Translate zero variance into an almost-sure affine relation.
  • Recognize the geometric meaning of an exact relation and distinguish it from near-singularity.
  • Work with examples of singular and nonsingular covariance matrices.

Why Singularity Signals an Exact Constraint

A covariance matrix summarizes the variances of individual components and their pairwise covariances. When it is singular, some direction in the space of components has no variation at all. This is stronger than saying that two variables are highly correlated: it means a nonzero linear combination is constant with probability one. The constant need not be zero, so the resulting constraint is generally an affine relation.

For example, if one measurement is always three times another minus four, the two measurements vary, but their values are confined to a line. The covariance matrix cannot distinguish movement along that line from movement in the full two-dimensional plane, because there is no variation perpendicular to the line. The precise equivalence below makes this geometric observation useful in calculations.

Definition: Let \(\boldsymbol X=(X_1,\ldots,X_p)^\mathsf{T}\) be a random vector whose components all have finite second moments, and write \(\boldsymbol\mu=E[\boldsymbol X]\). Its covariance matrix is the \(p\times p\) matrix \(\Sigma\) with entries \(\Sigma_{ij}=\operatorname{Cov}(X_i,X_j)\). The matrix is singular if it is not invertible. A nontrivial exact linear relation among the components means that there is a nonzero vector \(\boldsymbol c\in\mathbb R^p\) and a constant \(d\) such that \(\boldsymbol c^\mathsf{T}\boldsymbol X=d\) almost surely.

The finite-second-moment condition ensures that every covariance entry and every variance of a linear combination used below is finite. For a fixed vector \(\boldsymbol c=(c_1,\ldots,c_p)^\mathsf{T}\), the scalar \(\boldsymbol c^\mathsf{T}\boldsymbol X=\sum_{j=1}^p c_jX_j\) has variance

$$ \operatorname{Var}(\boldsymbol c^\mathsf{T}\boldsymbol X) =\sum_{i=1}^p\sum_{j=1}^p c_i c_j\operatorname{Cov}(X_i,X_j) =\boldsymbol c^\mathsf{T}\Sigma\boldsymbol c. $$

This is the quadratic-form version of the covariance rule for linear transformations. It explains why singularity is connected to zero variance: for a singular covariance matrix, some nonzero direction is annihilated by the matrix, and the corresponding quadratic form is zero.

The Singularity Equivalence

Theorem: Suppose \(\boldsymbol X\in\mathbb R^p\) has finite second moments and covariance matrix \(\Sigma\). The following statements are equivalent:
  1. \(\Sigma\) is singular.
  2. There is a nonzero \(\boldsymbol c\in\mathbb R^p\) such that \(\operatorname{Var}(\boldsymbol c^\mathsf{T}\boldsymbol X)=0\).
  3. There are a nonzero \(\boldsymbol c\in\mathbb R^p\) and a constant \(d\) such that \(\boldsymbol c^\mathsf{T}\boldsymbol X=d\) almost surely.
In the third statement, \(d\) must equal \(\boldsymbol c^\mathsf{T}\boldsymbol\mu\).

Proof. A square matrix is singular exactly when its null space contains a nonzero vector. Thus, if \(\Sigma\) is singular, there is a nonzero \(\boldsymbol c\) such that \(\Sigma\boldsymbol c=\boldsymbol 0\). Using symmetry of a covariance matrix and the quadratic-form identity,

$$ \operatorname{Var}(\boldsymbol c^\mathsf{T}\boldsymbol X) =\boldsymbol c^\mathsf{T}\Sigma\boldsymbol c =\boldsymbol c^\mathsf{T}\boldsymbol 0 =0. $$

Conversely, if a nonzero \(\boldsymbol c\) satisfies \(\operatorname{Var}(\boldsymbol c^\mathsf{T}\boldsymbol X)=0\), then \(\boldsymbol c^\mathsf{T}\Sigma\boldsymbol c=0\). Since \(\Sigma\) is a covariance matrix, it is positive semidefinite. By the spectral theorem, write \(\Sigma=Q\Lambda Q^\mathsf{T}\), where \(Q\) is orthogonal and \(\Lambda\) is diagonal with nonnegative entries. Then

$$ 0=\boldsymbol c^\mathsf{T}\Sigma\boldsymbol c =(Q^\mathsf{T}\boldsymbol c)^\mathsf{T}\Lambda(Q^\mathsf{T}\boldsymbol c) =\sum_{j=1}^p \lambda_j (Q^\mathsf{T}\boldsymbol c)_j^2. $$

Every term in this sum is nonnegative. Therefore, for each \(j\) with \(\lambda_j>0\), the corresponding coordinate \((Q^\mathsf{T}\boldsymbol c)_j\) is zero. It follows that \(\Lambda Q^\mathsf{T}\boldsymbol c=\boldsymbol 0\), hence \(\Sigma\boldsymbol c=\boldsymbol 0\). Since \(\boldsymbol c\ne\boldsymbol 0\), \(\Sigma\) is singular.

It remains to connect zero variance to an almost-sure relation. Set \(Y=\boldsymbol c^\mathsf{T}\boldsymbol X\) and \(m=E[Y]=\boldsymbol c^\mathsf{T}\boldsymbol\mu\). If \(\operatorname{Var}(Y)=0\), then \(E[(Y-m)^2]=0\). For every positive integer \(k\), nonnegativity gives

$$ 0=E[(Y-m)^2]\ \ge\ \frac{1}{k^2}P(|Y-m|\ge 1/k). $$

Thus \(P(|Y-m|\ge 1/k)=0\) for every \(k\). The event \(\{Y\ne m\}\) is the countable union of the events \(\{|Y-m|\ge 1/k\}\), so it also has probability zero. Therefore \(Y=m\) almost surely. In the other direction, if \(Y=d\) almost surely, then \(E[Y]=d\) and \(\operatorname{Var}(Y)=E[(Y-d)^2]=0\). This proves the equivalence and shows that the constant is \(d=\boldsymbol c^\mathsf{T}\boldsymbol\mu\). \(\square\)

The almost-sure qualification matters: an exact relation need not hold at every point in the underlying sample space. It holds except on an event of probability zero, which is enough to give the linear combination zero variance. In vector terms, the random vector lies almost surely in the affine hyperplane \(\{\boldsymbol x:\boldsymbol c^\mathsf{T}\boldsymbol x=d\}\). A singular covariance matrix therefore indicates that the distribution is confined to a lower-dimensional affine set, though that set may have dimension lower than \(p-1\) if there are several independent exact relations.

Worked Examples

Worked Example: Two Measurements With an Exact Scaling Relation

Let \(Z\) have mean \(2\) and variance \(9\). Define \(X_1=Z\) and \(X_2=3Z-4\). Find the covariance matrix and exhibit its exact relation.

The means are \(E[X_1]=2\) and \(E[X_2]=3(2)-4=2\). The variances and covariance are

$$ \operatorname{Var}(X_1)=9,\qquad \operatorname{Var}(X_2)=\operatorname{Var}(3Z-4)=9\operatorname{Var}(Z)=81, $$

and

$$ \operatorname{Cov}(X_1,X_2) =\operatorname{Cov}(Z,3Z-4) =3\operatorname{Var}(Z)=27. $$

Therefore

$$ \Sigma= \begin{pmatrix} 9&27\\ 27&81 \end{pmatrix}. $$

The nonzero vector \(\boldsymbol c=(-3,1)^\mathsf{T}\) gives \(\boldsymbol c^\mathsf{T}\boldsymbol X=-3Z+(3Z-4)=-4\) for every outcome. Correspondingly, \(\Sigma\boldsymbol c=\boldsymbol 0\), and \(\boldsymbol c^\mathsf{T}\Sigma\boldsymbol c=0\). The covariance matrix is singular, and its components satisfy the exact affine relation \(-3X_1+X_2=-4\).

Worked Example: A Component That Is the Sum of Two Others

Let \(A\) and \(B\) be independent Bernoulli random variables with success probability \(1/2\), and let \(C=A+B\). Find the covariance matrix of \((A,B,C)^\mathsf{T}\) and identify a null direction.

Each of \(A\) and \(B\) has variance \(1/4\), and independence gives \(\operatorname{Cov}(A,B)=0\). Since \(C=A+B\),

$$ \operatorname{Var}(C)=\operatorname{Var}(A)+\operatorname{Var}(B)+2\operatorname{Cov}(A,B)=\frac14+\frac14=\frac12. $$

The covariances with \(C\) are

$$ \operatorname{Cov}(A,C)=\operatorname{Cov}(A,A+B)=\frac14+0=\frac14, \qquad \operatorname{Cov}(B,C)=\operatorname{Cov}(B,A+B)=0+\frac14=\frac14. $$

Thus

$$ \Sigma= \begin{pmatrix} 1/4&0&1/4\\ 0&1/4&1/4\\ 1/4&1/4&1/2 \end{pmatrix}. $$

The vector \(\boldsymbol c=(1,1,-1)^\mathsf{T}\) gives \(A+B-C=0\) exactly. In matrix form, multiplying each row of \(\Sigma\) by this vector also gives zero. This is an exact linear relation even though none of the three individual components is constant.

Worked Example: Dependence Without a Singular Covariance Matrix

Let \(Z\) be uniform on \((-1,1)\), and set \(X_1=Z\) and \(X_2=Z^2\). These variables are dependent because \(X_2\) is determined by \(X_1\). Determine whether their covariance matrix is singular.

Symmetry gives \(E[Z]=E[Z^3]=0\). Direct integration gives

$$ E[Z^2]=\frac12\int_{-1}^1 z^2\,dz=\frac13, \qquad E[Z^4]=\frac12\int_{-1}^1 z^4\,dz=\frac15. $$

Therefore

$$ \operatorname{Var}(X_1)=\frac13,\qquad \operatorname{Cov}(X_1,X_2)=E[Z^3]-E[Z]E[Z^2]=0, $$

and

$$ \operatorname{Var}(X_2)=\frac15-\left(\frac13\right)^2=\frac4{45}. $$

The covariance matrix is diagonal with determinant \((1/3)(4/45)=4/135>0\), so it is nonsingular. There is no nonzero linear combination of \(Z\) and \(Z^2\) that is constant almost surely. This example shows that singularity detects exact affine relations, not dependence in general.

Interpreting the Relation and Avoiding a Common Mistake

If \(\boldsymbol c^\mathsf{T}\boldsymbol X=d\) almost surely, centering the components gives the equivalent relation \(\boldsymbol c^\mathsf{T}(\boldsymbol X-\boldsymbol\mu)=0\) almost surely. The covariance matrix records variation around the mean, so it is the centered relation that corresponds directly to a null direction. The uncentered form is often easier to interpret because it states the constraint in the original units.

A common mistake is to treat a very small variance as if it were zero. If \(\operatorname{Var}(\boldsymbol c^\mathsf{T}\boldsymbol X)\) is small but positive, the combination still varies with positive probability; the theorem does not give an exact relation. The covariance matrix may be close to singular, but it is not singular. In applications, near-singularity can make calculations sensitive, but it should not be reported as a mathematical identity without exact justification.

A related mistake is to conclude that a singular covariance matrix means two particular components must be equal or one must be a multiple of the other. The null vector may involve several components, and the relation may include a nonzero constant. For instance, \(X_3=X_1+X_2\) is a relation among three components, not a pairwise equality. To identify the constraint, find a nonzero vector in the null space of \(\Sigma\), then interpret its coefficients as a linear combination.

1
Find a null direction.
For a singular covariance matrix, solve \(\Sigma\boldsymbol c=\boldsymbol 0\) for a nonzero vector \(\boldsymbol c\).
2
Read off the exact relation.
The theorem gives \(\boldsymbol c^\mathsf{T}\boldsymbol X=\boldsymbol c^\mathsf{T}\boldsymbol\mu\) almost surely.
3
Check its scope.
Decide whether the relation is an identity of the model or holds only almost surely, and do not replace a merely small variance with zero.
Key takeaway: For a random vector with finite second moments, a covariance matrix is singular exactly when a nonzero linear combination of its components has zero variance. That combination equals its mean almost surely, placing the vector on an affine hyperplane.

Check Your Understanding

Use the theorem to connect matrix properties to exact constraints.

  1. For a finite-second-moment random vector \(\boldsymbol X\), what quantity does \(\boldsymbol c^\mathsf{T}\Sigma\boldsymbol c\) equal?
  2. If \(\boldsymbol c^\mathsf{T}\boldsymbol X=d\) almost surely, what is \(d\) in terms of \(\boldsymbol c\) and \(E[\boldsymbol X]\)?
  3. Suppose a covariance matrix is singular. What equation should you solve to find a direction that reveals an exact relation?
  4. Why does a small positive variance of a linear combination not establish an exact affine relation?
  5. Can a vector have dependent components and a nonsingular covariance matrix? Explain using the uniform-variable example.