PCA Lab - Cannot identify numbers in the Variance example

Under the section Understanding the Transformation Model there is an explanation of Variance and the Rotation. I’m unable to figure out where the following values came from :

  • Angle 45 degree
  • [0.166 0] Variance
  • x ~ U(1, 2)

I’m unable to relate these to the cell just above it.

Anyone able to explain them ? Thanks !

Hi Salih,

In the second cell of the notebook, n is set to 1 and y to x.copy() * n. In other words, y = x.

The rotation required to arrive at uncorrelated features is 45 degrees, with one eigenvector [-0.70710678, -0.70710678] pointing along x = y, and one eigenvector perpendicular (i.e. uncorrelated) [-0.70710678, 0.70710678], pointing along x = -y.

x contains 1000 samples from a uniform random distribution with low value of 1 and high value of 2. This is notated as x ~ U(1, 2). The variance of such a distribution is 1/12*9((high value - low value)**2) as proven here, which in this case is 0.083333.

This variance is found in both x and y. And the value of 0.166465230e-01 indicates that this variance is captured by the first principal component, while the variance captured by the second component is near zero. This is to be expected because x = y.

I hope this clarifies.