From Centered Observations to Scores
Principal component analysis (PCA) represents each observation using coordinates along a set of component directions. Those coordinates are the principal component scores. They are useful because they describe where an observation lies relative to the sample center, measured along directions chosen by PCA.
To calculate scores, the essential sequence is simple: center each observation, then take its inner product with each component direction. The details matter. Multiplying the original, uncentered observation by a direction generally gives a different number, and a sign has meaning only relative to the orientation of the direction being used.
In this definition, each direction is a \(p\)-dimensional column vector. For ordinary PCA, the directions are unit length and mutually orthogonal. The product \(ZV\) is defined because \(Z\) has \(p\) columns and \(V\) has \(p\) rows. The resulting score matrix has \(n\) rows and \(k\) columns: one score per observation and selected component.
For a single observation, write its centered row as \(z_i=x_i-\bar{x}\). Its row of scores is \(t_i=z_iV\). Equivalently, the score on direction \(v_j\) is \(t_{ij}=z_i v_j\), where the row-vector and column-vector multiplication is an inner product. Use the same variables, units, and centering convention used to define the PCA directions.
What the Score Says About an Observation
A score is a signed coordinate along a component direction. If the direction \(v_j\) is fixed, a positive score means the centered observation has a positive component along \(v_j\); a negative score means it lies in the opposite direction. A score of zero means the centered observation has no component along that direction. It does not mean that the observation is at the sample center: the observation may have nonzero scores on other components.
The comparison is always with the sample center. A positive score does not mean that the original measurements are positive, nor does it necessarily mean that every variable is above its mean. The score combines all centered variables according to the entries of the direction. For example, a direction may assign positive weight to one variable and negative weight to another.
Worked Example: Two Scores From a Centered Row
A hypothetical portfolio study uses two centered measurements, in the order “annual claim count” and “average claim size.” The sample mean vector is \(\bar{x}=(10,20)\). For this PCA, the two direction vectors are \(v_1=(3/5,4/5)^T\) and \(v_2=(-4/5,3/5)^T\). Find the scores for observations \(x_1=(13,24)\) and \(x_2=(8,19)\), and interpret their signs.
Method. Subtract the mean vector from each observation, then multiply each centered row by the direction matrix. The direction matrix, with the directions in its columns, is
For the first observation, the centered row is
Its first score is \(3(3/5)+4(4/5)=9/5+16/5=25/5=5\). Its second score is \(3(-4/5)+4(3/5)=-12/5+12/5=0\). Thus \(t_1=(5,0)\).
For the second observation,
Its first score is \((-2)(3/5)+(-1)(4/5)=-6/5-4/5=-10/5=-2\). Its second score is \((-2)(-4/5)+(-1)(3/5)=8/5-3/5=5/5=1\). Thus \(t_2=(-2,1)\).
Interpretation and check. Relative to the stated direction orientations, observation 1 is positive on component 1 and has zero coordinate on component 2. Observation 2 is negative on component 1 and positive on component 2. The arithmetic uses centered, not raw, measurements; each score follows directly from the corresponding inner product.
Matrix Calculation and a Justification
When there are several observations, compute the centered data matrix first and multiply once by the direction matrix. This keeps the row and column roles clear: a row of \(Z\) is an observation, while a column of \(V\) is a component direction.
The entry in row \(i\), column \(j\) of the product is \(z_i v_j\). In particular, the directions go in the columns of \(V\). If directions are instead written as rows, the corresponding calculation must use a transpose. Checking dimensions before multiplying is a quick way to catch this orientation error.
The inner-product formula follows from the meaning of a coordinate along a unit direction. Consider a centered row \(z\) and a unit direction \(v\). If \(t\) is the coordinate of \(z\) along \(v\), the part of \(z\) along the direction is \(tv\), and the remaining part \(r=z-tv\) must be perpendicular to \(v\). Perpendicularity means \(rv=0\), so
Since \(v\) is a unit vector, \(v^Tv=1\). Therefore \(t=zv\), the inner product used to calculate the score. For multiple mutually orthogonal unit directions, this argument applies separately to each direction, giving \(t_j=zv_j\) for every \(j\). Placing those results side by side gives the row calculation \(zV\).
Centering also gives a useful check on a complete score matrix. Each column of \(Z\) sums to zero because each variable was centered at its sample mean. Consequently,
Thus the sample mean of the scores on each component is zero, apart from possible rounding. This is a check on the calculation, not a statement that every individual score is zero.
Worked Example: Scores in Three Variables
A hypothetical risk team records three centered features for one account relative to a sample mean vector \(\bar{x}=(4,7,10)\). The account has raw measurements \(x=(7,6,12)\). The three component directions are the columns of
Find the three scores and check the result by verifying that the stated directions are mutually orthogonal unit vectors.
Step 1: Center. Subtract each sample mean from its corresponding measurement:
Step 2: Multiply by each direction. The first score is \(3(1/3)+(-1)(2/3)+2(2/3)=1-2/3+4/3=5/3\). The second score is \(3(2/3)+(-1)(1/3)+2(-2/3)=2-1/3-4/3=1/3\). The third score is \(3(2/3)+(-1)(-2/3)+2(1/3)=2+2/3+2/3=10/3\).
Therefore the score row is \(t=(5/3,1/3,10/3)\). These values describe the account relative to the sample center along the three stated directions: its first and second scores are positive, as is its third score.
Step 3: Check the directions. The squared length of the first direction is \((1+4+4)/9=1\); that of the second is \((4+1+4)/9=1\); and that of the third is also \((4+4+1)/9=1\). The first-second inner product is \((2+2-4)/9=0\), the first-third inner product is \((2-4+2)/9=0\), and the second-third inner product is \((4-2-2)/9=0\). The directions are indeed unit and mutually orthogonal, consistent with the calculation.
Reading a Score Matrix
A score matrix preserves the observation order of the original data: row \(i\) contains the scores for observation \(i\). Column \(j\) contains the scores for component \(j\). The first column is not automatically “the first variable”; it is the coordinate on the first component direction.
The size of a score indicates the distance along that particular direction from the center, in the units implied by the measurements and direction. A score should be interpreted relative to other scores on the same component. Comparing numerical sizes across components can require care because the components may have different variances. For this calculation, the immediate interpretation is the signed coordinate; the score itself does not say which original variable caused that position.
Worked Example: Building and Interpreting a Score Matrix
A hypothetical insurer summarizes two centered account features: a frequency measure and a severity measure. The sample mean is \(\bar{x}=(100,50)\). Use directions \(v_1=(0.8,0.6)^T\) and \(v_2=(-0.6,0.8)^T\) to calculate scores for \(x_1=(104,53)\), \(x_2=(97,46)\), and \(x_3=(100,54)\). State which observations are positive or negative on each component.
The direction matrix has the given vectors as columns:
For observation 1, \(z_1=(104-100,\ 53-50)=(4,3)\). Its scores are \(4(0.8)+3(0.6)=3.2+1.8=5\) and \(4(-0.6)+3(0.8)=-2.4+2.4=0\).
For observation 2, \(z_2=(97-100,\ 46-50)=(-3,-4)\). Its scores are \((-3)(0.8)+(-4)(0.6)=-2.4-2.4=-4.8\) and \((-3)(-0.6)+(-4)(0.8)=1.8-3.2=-1.4\).
For observation 3, \(z_3=(100-100,\ 54-50)=(0,4)\). Its scores are \(0(0.8)+4(0.6)=2.4\) and \(0(-0.6)+4(0.8)=3.2\). The score matrix is therefore
Observation 1 is positive on component 1 and zero on component 2; observation 2 is negative on both; observation 3 is positive on both. As a check, the first-column sum is \(5-4.8+2.4=2.6\), which is not zero. This signals that the data as stated do not have the claimed sample mean: the centered rows sum to \((1,3)\), not \((0,0)\). The scores are still correctly computed relative to the given reference vector, but they are not scores centered at the mean of these three observations. This distinction prevents an invalid zero-mean check from being treated as proof of an arithmetic error.
Common Mistake: Skipping the Centering Step
A frequent error is to multiply the raw observation by a component direction. For example, in the first worked example, using raw \(x_1=(13,24)\) with \(v_1=(3/5,4/5)^T\) gives \(13(3/5)+24(4/5)=39/5+96/5=27\). That is not the score relative to the stated sample center. The correct calculation subtracts \((10,20)\) first: \((3,4)v_1=9/5+16/5=5\). The value 27 mixes the location of the origin with the observation's position, which is why PCA scores from centered data use deviations from the mean.
Another trap is to calculate only one inner product when the question asks for several components. Each direction produces its own score, and the direction matrix must contain every requested direction as a separate column. Finally, interpret a negative score as “opposite the stated direction,” not as “below the mean on every variable.”
Check Your Understanding
For each problem, center first, then use the stated directions in the given order.
- A sample mean is \((12,8)\). An observation is \((15,12)\), and the direction is \(v=(3/5,4/5)^T\). Calculate its score and state its sign relative to that direction. (Answer: score \(5\), positive.)
- The mean is \((2,-1)\), the observation is \((0,2)\), and the directions are \(v_1=(0.6,0.8)^T\), \(v_2=(-0.8,0.6)^T\). Find both scores. (Answer: \((1.2,3.4)\).)
- The centered observation is \(z=(1,2,-1)\), and the three directions are the columns of the matrix in the three-variable worked example. Find its score row. (Answer: \((1,2,-1)\).)
- Three centered rows are \(z_1=(2,0)\), \(z_2=(-1,3)\), and \(z_3=(-1,-3)\). Using \(v_1=(0.8,0.6)^T\), compute the three scores on this direction and verify their sum. (Answer: \((1.6,1,-2)\); sum \(0.6\).)
- The mean is \((5,10)\), the observation is \((7,7)\), and the two directions are \(v_1=(3/5,4/5)^T\) and \(v_2=(-4/5,3/5)^T\). Find both scores and interpret the signs. (Answer: \((0,-3)\); zero on the first direction and negative on the second.)