On the previous page, you found a useful direction by rotating an axis. I called that direction PC1. You may now be asking: how can we calculate it without trying every angle?
We will get there together. First, I would like us to look more carefully at the centre of our data and at what it means for two quantities to change together.
I have kept your chosen thermoelectric observation. But before returning to all 5,205 records, let us try a deliberately small example whose arithmetic you can follow.
Let us try an idea—and see where it goes wrong
The three rows below are manufactured teaching values, not records from ESTM. Electrical conductivity increases while thermal conductivity decreases. We can see that immediately. Could a calculation help us describe it?
Use Next below. I will first try multiplying the values directly. Then you can change the numerical reference and see why we need a better starting point.
Now we can ask how this matrix finds an axis
You have seen why I subtract the means, what the products of deviations tell us, and how variance and covariance fit into a matrix. We are now ready to connect that matrix to the directions we explored on the first page.
In the experiment below, I have used the actual standardized conductivity logarithms from all 5,205 observations. Try rotating the arrow, and we will find the special directions together.
Try a direction and see what C does
Let us begin with the Direction angle slider. Turn it slowly and compare the teal arrow with the orange one. Then try PC1 and PC2: notice when the arrows line up, and I will explain what that tells us just below the experiment.
Why does one direction keep pointing the same way?
Try rotating the teal arrow. The orange arrow shows the result of multiplying it by C. Usually the two arrows do not lie on the same line. But at particular angles, C changes the arrow’s length while keeping it on that line.
That special direction is an eigenvector of C. The length multiplier is its eigenvalue. We write C v = λ v: v is the direction, and λ is the multiplier.
For a covariance matrix and a unit-length eigenvector, λ is also the variance along that direction. Now you can connect the names to what you already observed: we choose the eigenvector with the largest eigenvalue for PC1.
The perpendicular eigenvector gives PC2 in this two-variable example. Try both buttons. Notice that a special direction need not be the first component; we still have to compare the variances.
The sign of an axis is arbitrary. Reversing an arrow reverses every score on that axis but preserves its variance and the relationships between observations.
One more choice needs our attention
We have now built the covariance matrix and used it to find the axes. But I also divided the centred values by their standard deviations. Why make that extra choice? Let us carry your observation into Part 3 and change the units without changing the materials. You will see why our numerical scales deserve attention too.