0

I have a difference matrix from daily changes which I use to construct a covariance matrix. On this covariance matrix I use the power method to get the eigenvalues. The power method yields exactly the same eigenvalues as the eig function in matlab, so that should confirm my method is working. The only problem I have afterwards is that I don't know how to link the components to points in the covariance matrix. If I can't do this I don't know which of the points (dimensions) is the most important component. Also the eigenvector * covariance * eigenvector' doesn't give me the eigenvalue diagonal matrix because I think the eigenvalues are ranked from largest to smallest.

How can I link the eigenvalues and eigenvector to the components in the covariance matrix?

Oamriotn
  • 101
  • As far as I know the principal components are the eigenvectors of the covariance matrix. Are you asking how to compute the eigenvectors of the covariance matrix if you already know its eigenvalues ? – Holonomia Jun 18 '15 at 17:49
  • I also compute the eigenvectors from the power method, and I think they are correct. But because the power method ranks the eigenvalues I don't know how to link the eigenvalues/eigenvectors to particular points (dimensions). So I don't know how which dimensions explains the most although I know the eigenvalues – Oamriotn Jun 18 '15 at 17:55
  • So you already have the eigenvalues and the eigenvectors but you do not know how to link them. For example, you do not know which eigenvector corresponds to the largest eigenvalue of the covariance matrix, isn'it ? – Holonomia Jun 18 '15 at 18:09
  • Yes that's correct. I checked the eigenvalues with the eig function from matlab and they are the same. (Covariance - EigenvalueI)EigenVector gives zero which I think is correct. I think it is better to say i don't know how to link the eigenvalues and eigenvector with point on an interest rate curve. From this curve I got the covariance matrix. – Oamriotn Jun 18 '15 at 18:13

1 Answers1

0

Let $C$ your covariance matrix. As you told me you have already computed the eigenvectors. So put these eigenvectors as columns in a matrix $A$ i.e. the columns of $A$ are the eigenvectors you already know. Then perform the product $$A^{-1} C A $$ and you will see that it is a diagonal matrix $D = \rm diag \it (\lambda_1,\cdots,\lambda_n)$ with the eigenvalues $\lambda_i$ you already computed along the diagonal. The link between eigenvectors and eigenvalues is as follows: Call $A_i$ the $i$ column of $A$ i.e. the eigenvector you inserted in the $i$ column of $A$. Then $A_i$ is linked to $\lambda_i$ for $i = 1, \cdots, n$.

In particular, if $\lambda_{i_0}$ is the largest eigenvalue then the first principal component (also called first loading vector in https://en.wikipedia.org/wiki/Principal_component_analysis) is the eigenvector you inserted in the column $i_0$ i.e. $A_{i_0}$.

Holonomia
  • 2,543
  • I have the idea that because the eigenvalues are all ranked and so are the eigenvectors belonging to the eigenvalues that A−1CA doesn't yield the eigenvalues which you should get. I checked this in matlab where I got the eigenvalues and eigenvectors from the eig function from matlab but using these doesn't give me the correct eigenvalues in the end. Does it have something to do with the ranking of the eigenvalues? – Oamriotn Jun 18 '15 at 18:50
  • Above you told me that you checked that (Covariance - EigenvalueI)EigenVector gives zero. Checking this is the same as performing $A^{-1}CA = D$ . So I do not understand why you said that doing this \it 'doesn't yield the eigenvalues which you should get' \rm. Perhaps it is better you improve your question, since it is not clear if your problem is either theoretical or numerical (due to the numerical algorithms you are using to compute) or even practical due to the interpretation of the results in such rate curve from which you get the covariance matrix. – Holonomia Jun 19 '15 at 09:35
  • Sorry, had a small error in the code, it now gives me the eigenvalues in a diagonal matrix which I should get. So now I have the eigenvalues and the eigenvectors of a covariance matrix. The only think I still need to know is to which point in the covariance matrix does the biggest, second biggest and so on eigenvalue belong. That's the missing link at the moment and I don't know how to match these. – Oamriotn Jun 19 '15 at 18:19
  • What do you mean by a point in the covariance matrix? I was reading the wikipedia about PCA and there I could not find anything similar to 'a point in the covariance matrix'. Recall that once you get the largest eigenvalue and the corresponding eigenvector (that from your comment I assume you already got) you know the principal component and you can reduced your data to dimension 1 just by taking the inner product of the vectors (you used to construct the covariance matrix) against the eigenvector with largest eigenvalue. – Holonomia Jun 19 '15 at 20:43
  • I think you are right Holonomia. I don't think I need something like a point in the covariance matrix. I think I have enough information when I have all the eigenvalues and eigenvector. Thanks for your answers – Oamriotn Jun 20 '15 at 17:17