Tutorials › Multivariate Statistics (Graduate) › Projection Geometry for Principal Component Scores

Population and Sample PCA · Tutorial 486 of 975

Projection Geometry for Principal Component Scores

See how principal component scores determine a projected vector, and verify the key orthogonality and length identities in concrete examples.

Intermediate 9 min read

What You'll Learn

  • Define retained scores and fitted vectors from an orthonormal set of principal directions
  • Write the projection matrix onto the retained principal subspace
  • Prove symmetry, idempotence, and residual orthogonality
  • Relate the score norm to the norm of the fitted vector
  • Calculate projection identities for explicit vectors in two and three dimensions

Scores as Coordinates in a Principal Subspace

A principal component score is a coordinate, not a vector in the original variable space. For a centered observation, the retained scores tell us how far the observation extends along the retained principal directions. Multiplying those coordinates by the directions puts a vector back in the original variable space: its orthogonal projection onto the subspace spanned by those directions. Keeping these two roles distinct makes the geometry of principal component analysis (PCA) easier to read.

Let \(X\) be a \(p\)-dimensional random vector with finite second moments and mean \(\mu=E[X]\). Write \(Z=X-\mu\), and let \(\Sigma=\operatorname{Cov}(X)\). Since \(\Sigma\) is symmetric and positive semidefinite, choose orthonormal eigenvectors \(q_1,\ldots,q_p\), ordered with their eigenvalues from largest to smallest. For a retained dimension \(K\), where \(1\leq K\leq p\), place the first \(K\) directions in the \(p\times K\) matrix \(U_K=[q_1\ \cdots\ q_K]\). Then \(U_K^\mathsf{T}U_K=I_K\).

Definition: For a centered observation \(z\in\mathbb{R}^p\), its retained principal component score vector is \(t_K=U_K^\mathsf{T}z\in\mathbb{R}^K\). Its fitted vector in the original variable space is \(\hat z_K=U_Kt_K=U_KU_K^\mathsf{T}z\in\mathbb{R}^p\). The matrix \(P_K=U_KU_K^\mathsf{T}\) is the projection matrix onto the retained principal subspace \(\mathcal S_K=\operatorname{span}(q_1,\ldots,q_K)\).

The score \(t_K\) records coordinates in the retained directions; \(\hat z_K\) is a \(p\)-dimensional vector. If \(z\) is an uncentered observation \(x\), apply these definitions to \(z=x-\mu\). The corresponding fitted observation on the original scale is \(\mu+\hat z_K\). Thus the projection is performed on the centered vector, with the mean added back only when expressing the fitted observation in the original coordinates.

Why This Is an Orthogonal Projection

An orthogonal projection of \(z\) onto a subspace \(\mathcal S\) is a vector in \(\mathcal S\) whose difference from \(z\) is orthogonal to every vector in \(\mathcal S\). For the retained principal subspace, the columns of \(U_K\) form an orthonormal basis. The score calculation takes inner products with those basis directions, and the fitted-vector calculation combines the basis directions using those scores.

Theorem: For \(P_K=U_KU_K^\mathsf{T}\), \(P_K\) is symmetric and idempotent, and \(P_Kz\) is the orthogonal projection of \(z\) onto \(\mathcal S_K\). The residual \(r_K=z-\hat z_K\) is orthogonal to \(\mathcal S_K\). Moreover, \(\|\hat z_K\|^2=\|t_K\|^2\) and \(\|z\|^2=\|\hat z_K\|^2+\|r_K\|^2\).

Proof. Symmetry follows from

$$ P_K^\mathsf{T}=(U_KU_K^\mathsf{T})^\mathsf{T}=U_KU_K^\mathsf{T}=P_K. $$

Using \(U_K^\mathsf{T}U_K=I_K\), idempotence follows:

$$ P_K^2=U_KU_K^\mathsf{T}U_KU_K^\mathsf{T} =U_KI_KU_K^\mathsf{T} =P_K. $$

The fitted vector \(P_Kz=U_Kt_K\) lies in \(\mathcal S_K\), since it is a linear combination of the columns of \(U_K\). Its residual satisfies

$$ U_K^\mathsf{T}r_K =U_K^\mathsf{T}(z-U_KU_K^\mathsf{T}z) =U_K^\mathsf{T}z-(U_K^\mathsf{T}U_K)U_K^\mathsf{T}z =0. $$

Every vector in \(\mathcal S_K\) has the form \(U_Ka\) for some \(a\in\mathbb{R}^K\). Its inner product with the residual is \((U_Ka)^\mathsf{T}r_K=a^\mathsf{T}U_K^\mathsf{T}r_K=0\). Hence the residual is orthogonal to the whole subspace, which verifies the defining property of the projection. This property also ensures uniqueness: if two vectors in \(\mathcal S_K\) both had residuals orthogonal to \(\mathcal S_K\), their difference would lie in \(\mathcal S_K\) and be orthogonal to itself, so its squared norm would be zero and the two vectors would be equal.

For the score and fitted-vector lengths, use orthonormality again:

$$ \|\hat z_K\|^2 =(U_Kt_K)^\mathsf{T}(U_Kt_K) =t_K^\mathsf{T}U_K^\mathsf{T}U_Kt_K =t_K^\mathsf{T}t_K =\|t_K\|^2. $$

Finally, \(z=\hat z_K+r_K\), and the two terms are orthogonal because \(\hat z_K\in\mathcal S_K\) and \(r_K\) is orthogonal to \(\mathcal S_K\). Expanding the squared norm gives

$$ \|z\|^2 =\|\hat z_K+r_K\|^2 =\|\hat z_K\|^2+2\hat z_K^\mathsf{T}r_K+\|r_K\|^2 =\|\hat z_K\|^2+\|r_K\|^2. $$

This proves all the stated identities. \(\square\)

Worked Projection Calculations

Worked Example: One Retained Direction in Two Dimensions

Let \(q_1=(3/5,4/5)^\mathsf{T}\) be the retained unit principal direction, and let \(z=(5,0)^\mathsf{T}\). With \(K=1\), the score is the inner product with \(q_1\):

$$ t_1=q_1^\mathsf{T}z =\frac{3}{5}(5)+\frac{4}{5}(0)=3. $$

The fitted vector and residual are therefore

$$ \hat z_1=q_1t_1 =3\begin{pmatrix}3/5\\4/5\end{pmatrix} =\begin{pmatrix}9/5\\12/5\end{pmatrix}, \qquad r_1=z-\hat z_1 =\begin{pmatrix}16/5\\-12/5\end{pmatrix}. $$

Their inner product is \((9/5)(16/5)+(12/5)(-12/5)=144/25-144/25=0\), so the residual is perpendicular to the retained direction. The score and fitted-vector squared lengths agree:

$$ \|t_1\|^2=3^2=9, \qquad \|\hat z_1\|^2=(9/5)^2+(12/5)^2 =\frac{81+144}{25}=9. $$

The Pythagorean identity checks as well: \(\|z\|^2=25\), while \(\|\hat z_1\|^2+\|r_1\|^2=9+(256+144)/25=9+16=25\).

Worked Example: Two Retained Directions in Three Dimensions

Take the orthonormal directions \(q_1=(1,1,0)^\mathsf{T}/\sqrt{2}\), \(q_2=(1,-1,0)^\mathsf{T}/\sqrt{2}\), and \(q_3=(0,0,1)^\mathsf{T}\). Retain the first two and take \(z=(2,0,3)^\mathsf{T}\). The scores are

$$ t_2=U_2^\mathsf{T}z =\begin{pmatrix}q_1^\mathsf{T}z\\q_2^\mathsf{T}z\end{pmatrix} =\begin{pmatrix}\sqrt{2}\\\sqrt{2}\end{pmatrix}. $$

Combining those scores with their directions gives

$$ \hat z_2=U_2t_2 =\sqrt{2}q_1+\sqrt{2}q_2 =\begin{pmatrix}1\\1\\0\end{pmatrix} +\begin{pmatrix}1\\-1\\0\end{pmatrix} =\begin{pmatrix}2\\0\\0\end{pmatrix}, \qquad r_2=\begin{pmatrix}0\\0\\3\end{pmatrix}. $$

The projection matrix is \(P_2=q_1q_1^\mathsf{T}+q_2q_2^\mathsf{T}=\operatorname{diag}(1,1,0)\), so \(P_2z=(2,0,0)^\mathsf{T}\), as obtained from the scores. Also, \(U_2^\mathsf{T}r_2=(0,0)^\mathsf{T}\): the residual has no component in either retained direction. Finally, \(\|t_2\|^2=2+2=4=\|\hat z_2\|^2\), and \(\|z\|^2=13=4+9=\|\hat z_2\|^2+\|r_2\|^2\).

Worked Example: A Projection With Nonzero Residual Components

In \(\mathbb{R}^3\), consider the orthonormal directions \(q_1=(1,1,1)^\mathsf{T}/\sqrt{3}\), \(q_2=(1,-1,0)^\mathsf{T}/\sqrt{2}\), and \(q_3=(1,1,-2)^\mathsf{T}/\sqrt{6}\). Retain \(q_1,q_2\), and use \(z=(1,2,0)^\mathsf{T}\). The scores are

$$ t_2= \begin{pmatrix} q_1^\mathsf{T}z\\q_2^\mathsf{T}z \end{pmatrix} = \begin{pmatrix} 3/\sqrt{3}\\-1/\sqrt{2} \end{pmatrix} = \begin{pmatrix}\sqrt{3}\\-1/\sqrt{2}\end{pmatrix}. $$

Thus the fitted vector and residual are

$$ \hat z_2=\sqrt{3}q_1-\frac{1}{\sqrt{2}}q_2 =\begin{pmatrix}1\\1\\1\end{pmatrix} -\begin{pmatrix}1/2\\-1/2\\0\end{pmatrix} =\begin{pmatrix}1/2\\3/2\\1\end{pmatrix}, \qquad r_2=z-\hat z_2 =\begin{pmatrix}1/2\\1/2\\-1\end{pmatrix}. $$

The residual is not zero, but it is perpendicular to each retained direction: \(q_1^\mathsf{T}r_2=(1/2+1/2-1)/\sqrt{3}=0\) and \(q_2^\mathsf{T}r_2=(1/2-1/2)/\sqrt{2}=0\). The score squared length is \(3+1/2=7/2\); the fitted-vector squared length is \(1/4+9/4+1=7/2\). The original squared length is \(1+4=5\), and the residual squared length is \(1/4+1/4+1=3/2\), giving \(5=7/2+3/2\).

Reading the Identities Correctly

These calculations show what the score-to-vector conversion does: it maps the \(K\) retained coordinates back to the original \(p\)-dimensional space. The retained scores and the fitted vector have the same squared length because the columns of \(U_K\) are orthonormal. The residual describes the part of the centered observation perpendicular to every retained direction. These are geometric statements about the chosen subspace and the observation; they do not depend on the numerical values of the covariance eigenvalues.

When \(K=p\), the retained directions span all of \(\mathbb{R}^p\), so \(P_K=I_p\), the fitted vector equals \(z\), and the residual is zero. When \(K<p\), the residual may be nonzero, even though it has zero inner product with every retained direction. For an uncentered observation, the same statements apply after subtracting \(\mu\); adding \(\mu\) back shifts the fitted vector but does not change the centered projection calculations.

Common pitfall: Treating \(t_K\) itself as the fitted vector confuses a \(K\)-dimensional coordinate vector with a \(p\)-dimensional vector in the original variable space. The correction is to distinguish \(t_K=U_K^\mathsf{T}z\) from \(\hat z_K=U_Kt_K\). A related check is that the residual must satisfy \(U_K^\mathsf{T}(z-\hat z_K)=0\); it need not have every original coordinate equal to zero.

A practical verification can be made in three steps: calculate the scores, map them back with \(U_K\), and check orthogonality using \(U_K^\mathsf{T}r_K\). Comparing the score and fitted-vector lengths, and then checking the Pythagorean identity, provides independent arithmetic checks. The projection matrix \(P_K\) offers another route to the same fitted vector, since \(P_Kz=U_KU_K^\mathsf{T}z\).

Check Your Understanding

Use the definitions and identities above to answer the following questions.

  1. For \(U_K^\mathsf{T}U_K=I_K\), explain why \(U_KU_K^\mathsf{T}\) is idempotent.
  2. Why can the score vector and fitted vector have different dimensions but the same squared length?
  3. What equation verifies that a residual is orthogonal to the retained principal subspace?
  4. If \(K=p\) and the principal directions form an orthonormal basis of \(\mathbb{R}^p\), what are the fitted vector and residual?
  5. For an uncentered observation \(x\), which vector should be projected, and how is the fitted observation on the original scale expressed?
Clinical Biostats