Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Recovering original matrix from Eigenvalue Decomposition

Tags:

matlab

According to Wikipedia the eigenvalue decomposition should be such that:

http://en.wikipedia.org/wiki/Square_root_of_a_matrix

See section Computational Methods by diagonalization:

Sp that if matrix A is decomposed such that it has Eigenvector V and Eigenvalues D, then A=VDV'.

A=[1 2; 3 4];
[V,D]=eig(A);
RepA=V*D*V';

However in Matlab, A and RepA are not equal?

Why is this?

Baz

like image 983
Bazman Avatar asked Jul 03 '14 13:07

Bazman


1 Answers

In general, the formula is:

RepA = V*D*inv(V);

or, written for better numeric accuracy in MATLAB,

RepA = V*D/V;

When A is symmetric, then the V matrix will turn out to be orthogonal, which will make inv(V) = V.'. A is NOT symmetric, so you need the actual inverse.

Try it:

A=[1 2; 2 3];  % Symmetric
[V,D]=eig(A);
RepA = V*D*V';
like image 139
Peter Avatar answered Oct 11 '22 15:10

Peter