title: Numpy.eig and the percentage of variance in PCA
body: <p><a href="https://stackoverflow.com/questions/4801259/whats-wrong-with-my-pca">Picking up from where we left...</a></p>
  
  <p>So I can use linalg.eig or linalg.svd to compute the PCA. Each one returns different Principal Components/Eigenvectors and Eigenvalues when they're fed the same data (I'm currently using the Iris dataset).</p>
  
  <p>Looking <a href="http://onlinecourses.science.psu.edu/stat857/book/export/html/11" rel="nofollow noreferrer">here</a> or any other tutorial with the PCA applied to the Iris dataset, I'll find that the Eigenvalues are <code>[2.9108 0.9212 0.1474 0.0206]</code>. The <code>eig</code> method gives me a different set of eigenvalues/vectors to work with which I don't mind, except that these eigenvalues, once summed, equal the number of dimensions (4) and can be used to find how much each component contributes to the total variance.</p>
  
  <p>Taking the eigenvalues returned by <code>linalg.eig</code> I can't do that. For example, the values returned are <code>[9206.53059607   314.10307292    12.03601935     3.53031167]</code>. The proportion of variance in this case would be <code>[0.96542969  0.03293797  0.00126214  0.0003702]</code>. <a href="http://www.sjsu.edu/faculty/watkins/princmp.htm" rel="nofollow noreferrer">This other page</a> says that ("The proportion of the variation explained by a component is just its eigenvalue divided by the sum of the eigenvalues.") </p>
  
  <p>Since the variance explained by each dimension should be constant (I think), these proportions are wrong. So, if I use the values returned by <code>svd()</code>, which are the values used in all tutorials, I can get the correct percentage of variation from each dimension, but I'm wondering why the values returned by <code>eig</code> can't be used like that. </p>
  
  <p>I assume the results returned are still a valid way to project the variables, so is there a way to transform them so that I can get the correct proportion of variance explained by each variable? In other words, can I use the <code>eig</code> method and still have the proportion of variance for each variable? Additionally, could this mapping be done only in the eigenvalues so that I can have both the real eigenvalues and the normalized ones?</p>
  
  <p>Sorry for the long writeup btw. Here's a <code>(::)</code> for having gotten this far. Assuming you didn't just read this line.</p>