I'm data analyst without any good math background. I'm struggling to understand and to code myself eigen-decompositions. So far, I know QR algorithm of eigen-decomposition.
My problem. Let $\bf A$ be non-symmetric diagonalizible square real matrix. I performed basic QR algorithm on it and got $\bf A=QTQ'$, where $\bf Q$ is orthogonal eigenvectors and $\bf T$ is upper-triangular, the eigenvalues of $\bf A$ being on its diagonal.
But instead of it I want to get eigen solution $\bf A=VDV^{-1}$, with non-orthogonal eigenvectors $\bf V$ but diagonal matrix $\bf D$ with those eigenvalues.
Is it possible to obtain the second solution from the first, how? If not possible - what then would be the eigen-decomposition algorithm to apply to get the second solution? Maybe a modification of QR or another one, relatively simple (and I'm not interested in complex numbers anyway)? What would you suggest?
Illustration:
A (taken from Wikipedia "Diagonizible matrix")
1 2 0
0 3 0
2 -4 2
1. Do QR eigendecomposition
T (eigenvalues on the diagonal)
3.0000 -1.4142 4.6188
.0000 2.0000 .8165
.0000 .0000 1.0000
Q (orthogonal)
.4082 -.5774 -.7071
.4082 -.5774 .7071
-.8165 -.5774 .0000
A is restored by Q*T*Q'
2. Use MATLAB function [V,D]=eig(A,'nobalance') [Don't know how it works]
D (diagonal, same eigenvalues)
3.0000 .0000 .0000
.0000 2.0000 .0000
.0000 .0000 1.0000
V (nonorthogonal; still V*inv(V)=I)
-.5000 .0000 -.5000
-.5000 .0000 .0000
1.0000 -1.0000 1.0000
A is restored by V*D*inv(V)
Can I transform results (1) into results (2)?
If no, please recommend/show algorithm to arrive at (2).
Thank you!
Elements of $D$ are the eigenvalues, so they are the same as the diagonal elements of $T$.
Columns of $V$ are eigenvectors, but $A = V D V^{-1}$, called the Jordan decomposition, is numerically unstable, meaning that you can do it with the highest possible precision and still get $A \ne V D V^{-1}$. So, be sure that you really must use it.
As for your question, you can find a Jordan decomposition of a triangular matrix $T$ (for example, see here), which is easier than doing so for a general dense matrix.
My final advice would be: do not implement these yourself. Depending on what language or tool you are using, there are probably well though-of and well written functions that compute all of these decompositions. If there are not, you're probably using an inadequate tool. However, it still might be possible to call external programs written in more appropriate languages (i.e., Python, Matlab, Mathematica,...).