An eigen decomposition problem in programming

In summary, the conversation discusses the process of eigen decomposition of a covariance matrix using different methods such as LaEigSolve, svdcmp, eig() in MATLAB, and pcacov(). The differences in the resulting eigenvector matrices are also mentioned. The conversation ends with a suggestion to reconstruct the original matrix and compute the norm to determine the most reliable method.
  • #1
Asuralm
35
0
Hi all:

I have a covariance matrix which is like:

0.00166713 -0.00060678 4.60534e-05
-0.00060678 0.00178576 -0.000244526
4.60534e-05 -0.000244526 0.000772057

And then I want to eigen decompose the matrix to obtain the eigenvector matrix. I tried several methods, one is to use the LaEigSolve in the lapack++ library. This gives me the result:

0.655504 -0.742432 0.138237
-0.743371 -0.60208 0.291375
0.133097 0.293759 0.946568

Then I tried to use svdcmp routine of the Numerical recipe which gives me:

-0.655504 0.742432 0.138237
0.743371 0.60208 0.291375
-0.133097 -0.293759 0.946568

I also tried to use eig() in MATLAB which gives me:

-0.6555 0.7424 0.1383
0.7434 0.6021 0.2914
-0.1331 -0.2938 0.9465

By using pcacov(), the result is:

-0.6555 -0.7424 0.1383
0.7434 -0.6021 0.2914
-0.1331 0.2938 0.9465

Actually, I am writing a program of Pinciple Component Analysis in C++. But I don't really know which one is reliable and correct. The pcacov() seems to give me the correct result but I really don't understand why it's different from the others.

Can anyone help me with it please?

Thanks
 
Mathematics news on Phys.org
  • #2
reconstruct the original matrix let say Ahat by using your decomposed matrices, and compute the norm of |A-Ahat|. Then decide for yourself. Do this in a for loop for a couple of hundred matrices of course...
 

Related to An eigen decomposition problem in programming

1. What is an eigen decomposition problem?

An eigen decomposition problem, also known as eigendecomposition or spectral decomposition, is a mathematical process used to decompose a square matrix into a set of eigenvectors and eigenvalues. This allows for simplification and analysis of complex data sets and systems in fields such as data science and engineering.

2. How is an eigen decomposition problem used in programming?

An eigen decomposition problem is commonly used in programming for data analysis and machine learning tasks. It can be used to reduce the dimensionality of a dataset, classify data points, and identify patterns and relationships within the data.

3. What are the benefits of using an eigen decomposition problem in programming?

There are several benefits to using an eigen decomposition problem in programming. It can help reduce the complexity of data sets, improve the accuracy of machine learning algorithms, and provide a better understanding of the underlying structure and relationships within the data.

4. Are there any limitations to using an eigen decomposition problem in programming?

While an eigen decomposition problem can be a powerful tool in programming, there are some limitations to consider. It may not be suitable for large or sparse datasets, and it can be computationally expensive for high-dimensional matrices.

5. What are some real-world applications of an eigen decomposition problem in programming?

An eigen decomposition problem has a wide range of applications in fields such as image and signal processing, data compression, and financial analysis. It is also commonly used in machine learning algorithms for tasks such as face recognition, speech recognition, and recommendation systems.

Similar threads

  • Quantum Physics
Replies
5
Views
1K
  • General Math
Replies
11
Views
1K
  • Programming and Computer Science
Replies
12
Views
3K
  • Mechanical Engineering
Replies
5
Views
2K
  • Introductory Physics Homework Help
Replies
3
Views
1K
  • STEM Academic Advising
Replies
5
Views
946
Replies
8
Views
1K
  • Programming and Computer Science
Replies
1
Views
902
  • Programming and Computer Science
3
Replies
89
Views
4K
Replies
9
Views
2K
Back
Top