I have tried matlab eig command, it results true eigenvalues but wrong eigenvectors. I also tried direct iteration with rayleigh qotient which is better but doesn't give all eigenvectors also I have tried QR method which gives eigenvalues but not eigenvectors is there any algorithm that i can use to find eigenvalues and corresponding eigenvectors?
MATLAB's eig() function normalizes the eigenvectors to have unit norm; it doesn't normalize the eigenvalues. You can check the norm of the vectors to verify their correctness. Remember, if $\bf x$ is an eigenvector of $A$, then so is $c\,\bf x$.
You can "turn off" the normalization by using
[v,d] = eig(A,'nobalance')
but this also disables preconditioning and may give less accurate results.
-
$\begingroup$ I'm often annoyed by the "wrong" choice of signs even for real eigenvectors (wrong = not what I want aesthetically), and of course normalizing what might well be complex-valued eigenvectors is further fraught with surprise. $\endgroup$ – hardmath Aug 18 '13 at 15:40
"Wrong" eigenvectors is a poor problem statement in terms of how it helps us to help you. Are they merely of the wrong sign? Since the sign is arbitrary, that is impossible to control, but you can easily flip the signs if you don't like them.
One not uncommon convention is to always force the sign of the first non-zero element to be positive, but that too can be sometimes an issue if the first element were very near zero. How close is close enough?
Are there replicated eigenvalues? If so, then the eigenvectors for that set of replicated eigenvalues are not unique. You can essentially rotate the eigenvectors that span that subspace arbitrarily and they will still be equally valid eigenvectors.
So unless you give us more help as to why eig produced the "incorrect" eigenvectors, we can at best guess at the real problem.
eig
? If they were just imprecise, you could use the corresponding eigenvalues and the Inverse Iteration Method to refine them. $\endgroup$ – Pedro Aug 18 '13 at 12:52