Tutorials › Multivariate Statistics (Graduate) › Covariance of the Least-Squares Coefficient Matrix

Multivariate Regression Models · Tutorial 291 of 975

Covariance of the Least-Squares Coefficient Matrix

Derive the covariance formula for multivariate least-squares coefficients and interpret the separate roles of the design matrix and the covariance between outcomes.

Intermediate 12 min read

What You'll Learn

  • State the covariance conditions that yield the vectorized least-squares covariance formula
  • Derive the Kronecker-product expression from the model and the error covariance
  • Read individual coefficient variances and cross-outcome covariances from the result
  • Explain how predictor geometry changes coefficient uncertainty
  • Distinguish independence of cases from zero cross-case covariance
  • Apply the formula in numerical examples and a dependent-error example

Why Coefficient Covariance Has Two Components

In a multivariate regression, each predictor has a coefficient for every response. Uncertainty in those coefficients therefore has two sources: the design determines how precisely predictor effects can be separated, while covariance between responses determines how coefficient estimates for different outcomes vary together. The covariance of the full coefficient matrix combines these two structures in a single Kronecker product.

We derive that expression for a fixed, full-column-rank design and make its assumptions explicit. In particular, independence across cases is sufficient for the familiar formula, but it is not necessary: what the covariance calculation requires is a common within-case covariance and zero covariance between distinct cases.

Model, Vectorization, and Covariance Assumptions

Let \(Y\) be an \(n\times q\) response matrix, \(X\) a fixed \(n\times p\) design matrix of full column rank, and \(B\) a \(p\times q\) coefficient matrix. Write the multivariate linear model as \(Y=XB+E\), where \(E\) is the \(n\times q\) error matrix. The \(i\)th row of \(E\) is \(e_i'\), with \(e_i\) a \(q\)-dimensional column vector. Assume \(E[e_i]=0\).

We use column-wise vectorization: \(\operatorname{vec}(M)\) stacks the columns of a matrix \(M\) in order. Define \(A=(X'X)^{-1}\). The least-squares coefficient matrix is \(\hat B=AX'Y\), so that \(\hat B-B=AX'E\).

Covariance conditions: For every case \(i\), suppose \(\operatorname{Cov}(e_i)=\Sigma\), where \(\Sigma\) is a \(q\times q\) covariance matrix. For distinct cases \(i\ne l\), suppose \(\operatorname{Cov}(e_i,e_l)=0\), the \(q\times q\) zero matrix. These conditions imply \(\operatorname{Cov}(\operatorname{vec}(E))=\Sigma\otimes I_n\). Independent cases with common covariance \(\Sigma\) satisfy the conditions, but independence is not required.

The order of the factors matters. Under column-wise vectorization, the \(q\times q\) response covariance \(\Sigma\) indexes blocks, and each block is an \(n\times n\) matrix describing the case dimension. Thus the block in response positions \(j,k\) is \(\Sigma_{jk}I_n\).

Main Result and Derivation

Theorem: Under the model and covariance conditions above, with \(X\) fixed and full column rank, \(\operatorname{Cov}(\operatorname{vec}(\hat B))=\Sigma\otimes(X'X)^{-1}\). No normality assumption is needed for this covariance identity.

To establish the error covariance used in the theorem, partition \(\operatorname{vec}(E)\) into its \(q\) columns. The covariance block between columns \(j\) and \(k\) has \((i,l)\) entry \(\operatorname{Cov}(E_{ij},E_{lk})\). When \(i=l\), this entry is \(\Sigma_{jk}\); when \(i\ne l\), it is zero by the cross-case covariance condition. The entire block is therefore \(\Sigma_{jk}I_n\). Collecting all such blocks gives \(\operatorname{Cov}(\operatorname{vec}(E))=\Sigma\otimes I_n\).

Now let \(C=AX'\), a \(p\times n\) matrix. The vectorization identity \(\operatorname{vec}(CM)=(I_q\otimes C)\operatorname{vec}(M)\), for an \(n\times q\) matrix \(M\), gives \(\operatorname{vec}(\hat B-B)=(I_q\otimes C)\operatorname{vec}(E)\). For any fixed matrix \(K\) and random vector \(Z\), \(\operatorname{Cov}(KZ)=K\operatorname{Cov}(Z)K'\). Applying this rule and the mixed-product property of Kronecker products,

$$ \begin{aligned} \operatorname{Cov}(\operatorname{vec}(\hat B)) &=(I_q\otimes C)(\Sigma\otimes I_n)(I_q\otimes C')\\ &=\Sigma\otimes(CC')\\ &=\Sigma\otimes(AX'XA)\\ &=\Sigma\otimes A. \end{aligned} $$

In the last equality, \(A=(X'X)^{-1}\) is symmetric and \(AX'XA=A(X'X)A=A\). This proves the stated formula. \(\square\)

The same steps also show what changes if the error covariance conditions do not hold. If \(\Omega=\operatorname{Cov}(\operatorname{vec}(E))\) is the actual covariance matrix, then

$$ \operatorname{Cov}(\operatorname{vec}(\hat B)) =(I_q\otimes AX')\,\Omega\,(I_q\otimes XA). $$

The Kronecker formula follows when \(\Omega=\Sigma\otimes I_n\); if the covariance conditions fail, the covariance will generally differ from that formula.

Reading the Formula Coefficient by Coefficient

The vector \(\operatorname{vec}(\hat B)\) lists the estimated coefficients for response 1 first, then those for response 2, and so on. Consequently, \(\Sigma\otimes A\) is a \(q\times q\) array of \(p\times p\) blocks. Its block in response positions \(j,k\) is \(\Sigma_{jk}A\). In particular, for predictor indices \(a,b\) and response indices \(j,k\),

$$ \operatorname{Cov}(\hat B_{aj},\hat B_{bk})=A_{ab}\Sigma_{jk}. $$

This entry-wise statement follows directly by selecting entry \(a,b\) from block \(j,k\) of the Kronecker product. If \(j=k\), it gives the covariance between coefficients for the same response; if \(a=b\), it gives the covariance between coefficients on the same predictor for two responses. In particular, \(\operatorname{Var}(\hat B_{aj})=A_{aa}\Sigma_{jj}\).

The design contribution \(A\) describes predictor geometry. Collinear or poorly separated design columns tend to make entries of \((X'X)^{-1}\) large, raising coefficient variances. The response contribution \(\Sigma\) scales those variances by each outcome's error variance and determines how estimates across outcomes covary. A zero \(\Sigma_{jk}\) makes the corresponding cross-response coefficient covariance block zero, but it does not by itself assert independence.

Worked Example: Constructing the Full Covariance Matrix

Suppose \(n=4\), \(p=q=2\), and the design has an intercept and predictor values \(-1,0,1,2\). Then \(X'X=\begin{pmatrix}4&2\\2&6\end{pmatrix}\), whose determinant is \(4(6)-2(2)=20\). Thus

$$ A=(X'X)^{-1} =\frac{1}{20}\begin{pmatrix}6&-2\\-2&4\end{pmatrix} =\begin{pmatrix}0.3&-0.1\\-0.1&0.2\end{pmatrix}. $$

Let the response covariance be \(\Sigma=\begin{pmatrix}4&1.2\\1.2&9\end{pmatrix}\). This is a valid covariance matrix: its diagonal entries are positive and its determinant is \(4(9)-1.2^2=34.56>0\). In the ordering \((\hat B_{11},\hat B_{21},\hat B_{12},\hat B_{22})'\), the covariance is

$$ \Sigma\otimes A = \begin{pmatrix} 4A&1.2A\\ 1.2A&9A \end{pmatrix} = \begin{pmatrix} 1.2&-0.4&0.36&-0.12\\ -0.4&0.8&-0.12&0.24\\ 0.36&-0.12&2.7&-0.9\\ -0.12&0.24&-0.9&1.8 \end{pmatrix}. $$

For example, the variance of the intercept coefficient for response 1 is \(4(0.3)=1.2\), while the covariance between the two slope estimates is \(1.2(0.2)=0.24\). The covariance between the two intercept estimates is \(1.2(0.3)=0.36\). Each result is the product of the relevant entry of \(A\) and the relevant entry of \(\Sigma\).

Worked Example: Predictor Spread and Cross-Outcome Covariance

Take a design with an intercept and centered predictor values \(-2,-1,1,2\). Their sum is zero and their sum of squares is \(4+1+1+4=10\), so \(X'X=\begin{pmatrix}4&0\\0&10\end{pmatrix}\) and \(A=\begin{pmatrix}1/4&0\\0&1/10\end{pmatrix}\). Let \(\Sigma=\begin{pmatrix}1&0.6\\0.6&4\end{pmatrix}\), which is positive definite because its determinant is \(4-0.36=3.64>0\).

The variance of the slope estimate for response 1 is \((1/10)(1)=0.1\); for response 2 it is \((1/10)(4)=0.4\). The covariance between those two slope estimates is \((1/10)(0.6)=0.06\). Their correlation is \(0.06/\sqrt{0.1(0.4)}=0.3\), the same as the response-error correlation \(0.6/\sqrt{1(4)}=0.3\). Centering makes the intercept-slope entries of \(A\) zero, so the intercept estimate and slope estimate for a given response have zero covariance under this design.

If every predictor value is doubled, the centered predictor sum of squares becomes \(4(10)=40\). The inverse design entry for the slope becomes \(1/40\), so the slope variances become \(1/40=0.025\) and \(4/40=0.1\), and their covariance becomes \(0.6/40=0.015\). This is not a claim that changing units creates more information about the same coefficient: the coefficient of the doubled predictor is half the original slope, and its variance is one quarter as large.

Worked Example: Dependent Errors Can Still Give the Formula

Let \(U\) take values \(-1,0,1\) with probabilities \(1/3\) each. Define two scalar case errors by \(e_1=\sqrt{3/2}\,U\) and \(e_2=(3/\sqrt{2})(U^2-2/3)\). Both have mean zero. Since \(E[U^2]=2/3\), \(\operatorname{Var}(e_1)=(3/2)(2/3)=1\). Also, \(E[(U^2-2/3)^2]=(2/3)(1/9)+(1/3)(4/9)=2/9\), so \(\operatorname{Var}(e_2)=(9/2)(2/9)=1\).

Their covariance is \(\operatorname{Cov}(e_1,e_2)=(3\sqrt{3}/2)E[U(U^2-2/3)]=0\), because the distribution of \(U\) is symmetric and both \(E[U^3]\) and \(E[U]\) are zero. The errors are nevertheless dependent: \(e_2\) is a nonconstant function of \(U\), and \(e_1\) determines \(U\). Thus \(\operatorname{Cov}(e_1,e_2)=0\) does not imply independence.

For an intercept-only model with \(X=(1,1)'\), \(A=(X'X)^{-1}=1/2\). The two errors each have variance one and have zero cross-case covariance, so the stacked error covariance is \(I_2\), even though the errors are dependent. The fitted intercept is the average of the two observations, and its variance is \((1/2)^2(1+1)=1/2\). The covariance formula gives the same answer: \(\Sigma A=1(1/2)=1/2\). This verifies that independence is sufficient, not necessary, for the covariance result.

Common Pitfall and Practical Interpretation

A common mistake is to say that dependence between cases automatically invalidates \(\operatorname{Cov}(\operatorname{vec}(E))=\Sigma\otimes I_n\). Dependence does not automatically mean nonzero covariance. The covariance calculation uses only the individual case covariance matrices and the cross-case covariances; dependent errors can still have zero cross-case covariances. Conversely, if cross-case covariances are nonzero, or the case covariance matrices differ, the stacked covariance generally is not \(\Sigma\otimes I_n\), and the general expression involving \(\Omega\) should be used instead.

A second pitfall is to read a covariance matrix as a complete description of the joint distribution. The theorem gives variances and covariances; without additional distributional assumptions, it does not establish normality or independence of the estimated coefficients. The formula is useful precisely because it separates design uncertainty from response covariance without requiring normal errors.

Key takeaway: With full-rank fixed \(X\), common within-case covariance \(\Sigma\), and zero cross-case covariances, \(\operatorname{Cov}(\operatorname{vec}(\hat B))=\Sigma\otimes(X'X)^{-1}\). The predictor geometry determines the coefficient covariance pattern, while \(\Sigma\) determines its outcome scaling and cross-outcome association.

Check Your Understanding

Use the model, vectorization convention, and covariance assumptions stated above.

  1. Why does column-wise vectorization make the block in response positions \(j,k\) equal to \(\Sigma_{jk}I_n\)?
  2. If \(\Sigma_{jj}=2\) and \(A_{aa}=0.3\), what is \(\operatorname{Var}(\hat B_{aj})\)?
  3. What does the \((j,k)\) response block of the coefficient covariance matrix equal?
  4. Explain why independent cases are sufficient but not required for the theorem.
  5. If \(X'X\) is diagonal, what does that imply about covariance between coefficients on distinct predictors for the same response under this formula?
Clinical Biostats