Introduction
PCA replaces a collection of measured variables with directions through the data that summarize variation. Once those directions have been found, each observation can be described by its coordinate along each direction. That coordinate is its principal component score.
Geometrically, a score is a projection: it measures how far an observation lies along a component direction. The observation must first be expressed relative to the data center used to fit PCA. For correlation-based PCA, it must also be expressed in the standardized units used to fit the components.
Projection onto a Component Direction
A direction is represented by a unit vector \(v\), so \(v^\mathsf{T}v=1\). The scalar projection of a centered observation \(z\) onto that direction is \(z^\mathsf{T}v\). The corresponding vector projection is \((z^\mathsf{T}v)v\). The scalar is the PCA score; the vector points from the origin to the projected location.
PCA directions obtained from a covariance matrix or correlation matrix are eigenvectors. For a symmetric matrix, its eigenvectors can be chosen orthonormal. Thus, for two distinct component directions \(v_1\) and \(v_2\), \(v_1^\mathsf{T}v_2=0\), and each direction has unit length. These conditions are what make the component scores coordinates along perpendicular axes.
Why the Dot Product Gives the Projection
The score formula follows from the definition of an orthogonal projection. Among all points on the line through the origin in direction \(v\), write a candidate point as \(cv\), where \(c\) is a scalar. The squared distance from \(z\) to this candidate is
where \(v^\mathsf{T}v=1\) has been used. This quadratic is minimized when its derivative with respect to \(c\) is zero:
Therefore the closest point on the component line is \((z^\mathsf{T}v)v\), and its signed coordinate is \(z^\mathsf{T}v\). The perpendicularity condition can also be checked directly:
The residual from the projection is perpendicular to the direction, as required. If a direction vector is not unit length, the coefficient is instead \(z^\mathsf{T}v/(v^\mathsf{T}v)\). PCA eigenvectors are conventionally normalized to unit length, so the simpler score formula applies.
Worked Two-Dimensional Projections
In two dimensions, write a centered observation as \(z=(z_1,z_2)^\mathsf{T}\) and a component direction as \(v=(v_1,v_2)^\mathsf{T}\). The score is \(z_1v_1+z_2v_2\). Before taking that dot product, identify whether the fitted PCA used centered measurements or standardized measurements.
Worked Example: Projecting a Centered Observation
A covariance-based PCA model was fitted to two measurements. The training means are 10 and 5. Its first two component directions are \(v_1=(3/5,4/5)^\mathsf{T}\) and \(v_2=(-4/5,3/5)^\mathsf{T}\). Find the scores and projection vectors for a new observation \(x=(14,6)^\mathsf{T}\).
Method. Center the observation using the training means, then take its dot product with each unit component direction.
Step 1: Center the observation.
Step 2: Calculate the component scores.
Step 3: Find each vector projection. Multiply each score by its direction:
Check. The directions are unit length and perpendicular: \(3^2+4^2=25\), and \((3/5)(-4/5)+(4/5)(3/5)=0\). The projection vectors add to \((4,1)^\mathsf{T}\), matching the centered observation. The score pair is therefore \((3.2,-2.6)\).
Common mistake avoided: using the raw observation \((14,6)\) in the dot products. The PCA axes are based at the training-data center, so the correct input is \((4,1)\), not \((14,6)\).
Worked Example: Scores from Correlation-Based PCA
A two-variable PCA uses standardized measurements. In the training data, the variable means are 50 and 20, and the sample standard deviations are 10 and 4. The fitted directions are \(v_1=(1/\sqrt{2},1/\sqrt{2})^\mathsf{T}\) and \(v_2=(1/\sqrt{2},-1/\sqrt{2})^\mathsf{T}\). Find the scores for an observation with raw values \((65,16)\). Give scores to four decimal places.
Method. Apply the training standardization to each value, then project the resulting standardized vector.
Step 1: Standardize both measurements. The standardized values are the differences from the training means divided by the corresponding training standard deviations:
Thus the vector used for projection is \(z=(1.5,-1)^\mathsf{T}\).
Step 2: Project onto each direction.
Check. The squared length of the standardized observation is \(1.5^2+(-1)^2=3.25\). The squared scores sum to approximately \(0.3536^2+1.7678^2=0.1250+3.1250=3.2500\), as expected for coordinates along a complete orthonormal basis.
Common mistake avoided: projecting the raw differences \((15,-4)\) without dividing by the standard deviations. That would use the units and scale of the measurements, not the standardized coordinates on which this correlation-based PCA was fitted.
Scores for Several Observations
The same projection calculation applies row by row. If the centered data matrix is \(Z\) and the matrix \(V\) has the component directions as its columns, the score matrix is \(T=ZV\). Its entry in row \(i\), column \(j\) is the dot product of centered observation \(i\) with direction \(j\). For standardized PCA, \(Z\) here denotes the matrix after applying the training means and standard deviations.
This matrix expression is a compact way to perform separate projections, not a different definition. Each row is multiplied by the direction vectors, so the output records each observation's coordinates along those directions.
Worked Example: Calculating Scores for Three Centered Points
A fitted two-dimensional PCA has directions \(v_1=(3/5,4/5)^\mathsf{T}\) and \(v_2=(-4/5,3/5)^\mathsf{T}\). Three observations, already centered using the training means, are \(z_A=(2,1)^\mathsf{T}\), \(z_B=(-1,2)^\mathsf{T}\), and \(z_C=(-1,-3)^\mathsf{T}\). Calculate each score pair and check the results.
Method. Compute each observation's dot product with each direction.
Observation A:
Observation B:
Observation C:
The score pairs are therefore \(A:(2,-1)\), \(B:(1,2)\), and \(C:(-3,-1)\). As a check, the centered observations sum to zero, \((2,1)+(-1,2)+(-1,-3)=(0,0)\), and the scores also sum to zero in each component: \(2+1-3=0\) and \(-1+2-1=0\).
A second check uses lengths. For A, \(2^2+(-1)^2=5=2^2+1^2\). For B, \(1^2+2^2=5=(-1)^2+2^2\). For C, \((-3)^2+(-1)^2=10=(-1)^2+(-3)^2\). Orthonormal coordinates preserve squared length when both component directions are included.
Common mistake avoided: treating the pair of scores as if each were an original measurement. They are coordinates along the fitted directions, not the original variable values.
Checks, Conditions, and Exam Traps
Projection scores are straightforward to compute, but a few conditions matter. The direction vector must be the one fitted by the PCA being applied, and the observation must be centered or standardized consistently with that fit. If the vector supplied is not unit length, the ordinary dot product is not the projection coefficient; divide by its squared length. If only some component directions are used, the resulting scores give coordinates along those directions only.
When all \(p\) orthonormal directions are included, the squared length of the centered or standardized observation equals the sum of its squared scores:
This follows by expressing \(z\) in an orthonormal basis: its coordinate in direction \(v_j\) is \(t_j=z^\mathsf{T}v_j\). The identity is a useful arithmetic check, but it requires the complete basis. It need not hold if only a subset of component directions is included.
For an observation from outside the training data, do not recalculate the training means or standard deviations using that observation. Apply the fitted preprocessing and directions. This keeps the new score on the same coordinate system as the scores of the observations used to fit the PCA.
These calculations are aligned with the SOA Exam SRM (Statistics for Risk Modeling) syllabus. A reliable solution states the preprocessing, writes the centered or standardized vector, and then shows the dot products. In two dimensions, checking that the directions are unit and perpendicular and that the projected coordinates are consistent with the input can catch arithmetic and scaling errors.
Check Your Understanding
For each problem, show the preprocessing step before calculating component scores.
- A covariance-based PCA has training means \((4,7)\) and first direction \(v=(3/5,4/5)^\mathsf{T}\). Find the score for \(x=(9,5)\). (Answer: \(1.4\))
- A correlation-based PCA uses training means \((100,30)\), standard deviations \((20,5)\), and direction \(v=(1/\sqrt{2},-1/\sqrt{2})^\mathsf{T}\). Find the score for \(x=(120,25)\), to four decimals. (Answer: \(1.4142\))
- Let \(z=(-2,4)^\mathsf{T}\) and \(v=(4/5,3/5)^\mathsf{T}\). Find the score and the vector projection. (Answer: score \(=0.8\); projection \(=(0.64,0.48)^\mathsf{T}\))
- For the orthonormal directions \(v_1=(1/\sqrt{2},1/\sqrt{2})^\mathsf{T}\) and \(v_2=(1/\sqrt{2},-1/\sqrt{2})^\mathsf{T}\), calculate both scores for \(z=(3,-1)^\mathsf{T}\), then verify the squared-length check. (Answer: scores \((\sqrt{2},2\sqrt{2})\); both squared lengths equal \(10\))
- A fitted PCA uses the unit direction \(v=(3/5,4/5)^\mathsf{T}\). A centered point has score \(2.5\) on this direction. Find its vector projection and state the defining perpendicularity check for the residual. (Answer: projection \(=(1.5,2.0)^\mathsf{T}\); the residual's dot product with \(v\) is \(0\))