PCA: the Equations of the Components

Each principal component is a weighted sum of the variables, \( \mathbf{z}_k = \phi_{1k}\mathbf{x}_1 + \phi_{2k}\mathbf{x}_2 + \dots + \phi_{pk}\mathbf{x}_p \) with \( \sum_{j=1}^{p} \phi_{jk}^2 = 1 \). Arrow \(k\) in the picture points along the weights \( \boldsymbol{\phi}_k = (\phi_{1k}, \dots, \phi_{pk}) \).

Drag the picture to turn it. Drag the pink arrow to turn your direction. Point at a dot to compute its scores.

The data

  • \( \mathbf{x}_1 \) =
  • \( \mathbf{x}_2 \) =
  • \( \mathbf{x}_3 \) =

The components are ordered by \( \lambda_k = \mathrm{Var}(\mathbf{z}_k) \), largest first. Each arrow is \( 2\sqrt{\lambda_k} \) long. Multiplying \( \boldsymbol{\phi}_k \) by \( -1 \) turns the arrow around and leaves \( \lambda_k \) alone.

0

One dot: \( z_{ik} = \phi_{1k}X_{i1} + \dots + \phi_{pk}X_{ip} \)