structural:reformatting
First component

In order to maximize variance, the first weight vector w thus has to satisfy

Equivalently, writing this in matrix form gives

Since w has been defined to be a unit vector, it equivalently also satisfies

The quantity to be maximised can be recognised as a Rayleigh quotient. A standard result for a positive semidefinite matrix such as X X is that the quotient's maximum possible value is the largest eigenvalue of the matrix, which occurs when w is the corresponding eigenvector.

With w found, the first principal component of a data vector x can then be given as a score t = x ⋅ w in the transformed co-ordinates, or as the corresponding vector in the original variables, { x ⋅ w } w.